MySQL on Windows: MySQL Installation and Company Dataset Import Instructions Part I: MySQL Installation Instructions on Windows 1) MySQL Server distributions for Windows can be downloaded from: http://dev.mysql.com/downloads/mysql/. a. Scroll down to the Generally Available (GA) Releases tabbed section of the page. b. For installation from ZIP archive: i. Click the Download button corresponding to the software name Windows (x86, 32-bit), ZIP Archive for a 32-bit processor, or Windows (x86, 64-bit), ZIP Archive for a 64-bit processor, and save the zipped file on your computer. ii. Go to the location where the zipped file is saved and extract its contents to a chosen location (e.g. C:\, or C:\Program Files\). To simplify things, rename the extracted folder from mysql-5.6.16-winx32, or mysql-5.6.16-winx64 to just mysql. iii. Within the folder, the bin directory has all the binaries for starting the server and accessing the database from command line. iv. Next, add the mysql\bin directory path to the Path environment variable on Windows as follows: 1. Right click on My Computer and select Properties. Then click Advanced system settings in the newly opened window, which should open another new window called System Properties. 2. On the Advanced tab click the Environment Variables button. In the System Variables section scroll down to the variable that says Path. Select it and click on the Edit button. 3. In the Variable value text field, go all the way to the end of the line, and if there is no semicolon already at the end then add one. After the semicolon, type the full MySQL installation bin directory path as C:\mysql\bin\, or C:\Program Files\mysql\bin\, or another as chosen, and click OK. Click OK on the Environment Variables window; click OK on the System Properties window. Then finally, close the Control Panel window. v. Open up a Command Prompt by typing cmd in the Start menu’s search bar. Right click on cmd.exe and choose Run as administrator. vi. The next step is to install MySQL as a Windows service: Type in the line mysqld --install on the Command Prompt, and press <Enter>. The message Service successfully installed should appear. 2) For access to query window: a. Start the database service: Type mysqld --console on the command line. It will output several messages on the console. When the server finishes its startup sequence, you should see something like the lines below, which indicates that the server is ready to service client connections: 2014-02-11 00:36:41 3228 [Note] mysqld: ready for connections. Version: '5.6.16' socket: '' port: 3306 MySQL Community Server (GPL) b. Password configuration steps during first-time access: i. Open a new Command Prompt as administrator in the same manner as done previously. Type mysql -u root -p on the console and hit <Enter>. When it asks for password hit <Enter> again as there is no password set, and you are now in the MySQL monitor interface (a.k.a. MySQL query window) where you can type in SQL queries for database access. ii. Set password for root account: In the MySQL query window, type use mysql;. It should show message Database changed. Then type the command update mysql.user setpassword = password('specify_your_password') where user = 'root';. On executing the query, the messages below will appear. Query OK, 3 rows affected (0.08 sec) Rows matched: 3 Changed: 3 Warnings: 0 iii. Next type command flush privileges; and then type quit. c. Once the password is set, for subsequent access to the query window: i. In the Command Prompt type mysql -u root -p on the console and hit <Enter>. When prompted for password, type the set password and then hit <Enter>. You will be in the MySQL query window. NOTE: Closing the command prompt where the MySQL service was started using instruction (a) stops the service. Stopping the service prevents any queries to be executed on MySQL. Part II: Instructions to import Company Dataset into MySQL 1) Right-click and save file create-company-data.sql from eLearning to your computer. The file can be stored anywhere – say for example, it is saved in location C:\mysql\. 2) From Part I, use instruction (a) to start the database service if there isn’t one started already, and then use instruction (c) on a new Command Prompt to open a query window. 3) Import Dataset: Type command source <directory_path>\create-company-data.sql. Using the example path from step 1, the command will be source C:\mysql\create-company-data.sql. This command runs the sql script creating the Company database with all its objects, as well as populates the database with
View Full Document