Mysql and Workbench Installation and Use Guide: Course Information Systems, Aarhus University, Q2, 2010
Mysql and Workbench Installation and Use Guide: Course Information Systems, Aarhus University, Q2, 2010
Contents
1 MySQL Community Server ............................................................................................................................................. 2 2 MySQL Workbench ........................................................................................................................................................ 7 2.1 Installation Guide .................................................................................................................................................... 7 2.2 Short User Guide ..................................................................................................................................................... 9 2.2.1 Configure new database connection ............................................................................................................... 9 2.2.2 Loading an example database........................................................................................................................ 11 2.2.3 Populate database with data ......................................................................................................................... 13
2.
Open installation file for MySQL Community Server and press Next.
3.
4.
After installation process is completed, check Configure MySQL Server now and click Finish.
5.
6.
7.
We recommend that you check Install As Windows Service, select service name MySQL. Check Launch the MySQL Server Automatically so it will run service automatically after installation. Check to Include Bin Directory in Windows PATH and click Next.
8.
We recommend that you set a long password for the root user (and remember it!), check Enable root access from remote machines and do not create an anonymous account. Click Next and then Execute.
9.
Note: If you want to reconfigure MySQL Community Server, click Start > All Programs > MySQL > MySQL Server 5.1 > MySQL Server Instance Configure Wizard.
3.
4.
1.
Launch MySQL Workbench (in your start menu, choose MySQL from your installed programs, and choose Workbench).
2.
3.
If you installed MySQL Server under default settings, you should not change anything here. (Otherwise enter the name, hostname and port number for the connection.) Enter the password for the root user, which you set while installing MySQL Server and click Test Connection. The following screen will appear.
4.
Click OK. In the Workspace of MySQL Workbench select the database connection.
10
5.
2.2.2 Loading an example database 1. 2. Open a Database connection as described in 2.2.1 section. In Object Browser from the dropdown select default database. In the example database test is selected.
3. 4.
Download courseDB.sql file from the course webpage. This file contains SQL commands to create DB table with the name course. Select File > Open SQL Script File, select the downloaded courceDB.sql file and click Open.
11
5.
6.
Right-click on the database name in Object Browser and click Refresh All.
12
7.
1.
2.
Download files from course page: loadCourseDB.sql - file contains SQL commands for populating DB table with data from specified input file. course.txt data file for the course table (If youre curious, you can open this file with a text editor to see what it contains). Open loadCourseDB.sql SQL script file with MySQL Workbench, as described in Section 2.2.2.
3.
Before executing the script: In the line LOAD DATA INFILE specify the location to which you downloaded the course.txt file (c:/course.txt in the example); If you used the suggested names, you do not need to change anything else. If you chose a different name for the database or the table, change line INTO TABLE test.course accordingly, i.e. name for table course in test database. Click Execute SQL Script in Connected Server.
13
4.
Right-click on the table name course and select Select Rows - Limit 1000.
5.
The result set with five records (= five lines in the table) will appear (as in the text file).
Congratulations! You have successfully installed and tested MySQL and the Workbench!
14