Download MySQL tutorial Emile Chungtien Chi and install MYSQL

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

IMDb wikipedia , lookup

Entity–attribute–value model wikipedia , lookup

Oracle Database wikipedia , lookup

Microsoft SQL Server wikipedia , lookup

Open Database Connectivity wikipedia , lookup

Extensible Storage Engine wikipedia , lookup

Concurrency control wikipedia , lookup

Database wikipedia , lookup

Microsoft Jet Database Engine wikipedia , lookup

Ingres (database) wikipedia , lookup

Relational model wikipedia , lookup

Versant Object Database wikipedia , lookup

Clusterpoint wikipedia , lookup

ContactPoint wikipedia , lookup

Database model wikipedia , lookup

Transcript
MySQL tutorial
Emile Chungtien Chi
Download and install MYSQL 5.1
Go to this url: http://dev.mysql.com/downloads/mysql/5.1.html#win32
Choose Windows Essentials and pick a mirror. I chose the Semaphore Corp http
Note that just below pick a mirror the MD5 signature is displayed. You will use this to verify that the download has not
been hacked.
Register as a new user or skip this and just download MySQL
Next go to this url: http://www.fourmilab.ch/md5/
Download md5.zip.
Unzip this to extract the command line program md5.exe.
Put both md5.exe and mysql-essential-5.1.30-win32.msi in the same folder
Start a command prompt and navigate to this folder, then type:
md5 mysql-essential-5.1.34-win32.msi
The md5 checksum will displayed and should match the one given on the MySQL download page.
If it does, it is safe to proceed. If not choose another mirror and repeat the above steps.
Run the wizard to install MySQL – choose typical installation
Run the MySQL Server Instance Configuration Wizard
Choose Standard Configuration
Choose Install as Windows Service
Pick a password
Click Execute
Click Finish
Download and save the MySQL 5.1 Reference Manual
http://dev.mysql.com/doc/refman/5.1/en/
Download and install MYSQL GUI Tools
Go to this url: http://dev.mysql.com/downloads/gui-tools/5.0.html
Choose Windows (X86) and pick a mirror
Download the MySQL GUI Tools
Run the wizard to install the tools – choose complete installation
To run the MySQL Administrator use host localhost, user root, and the password you created when running the
configuration wizard.
The Administrator can be used to tell you everything you need to know about the MySQL server on your computer. You
can use it to backup and restore your databases to your jump drive.
To run the Administrator use host localhost, user root, and your password.
To run the MySQL Query Browser use host localhost, user root, and your password. Use default schema test.
I have a small teaching database univ09 which will be used to test your installation of MySQL.
To get this database, go to this url: http://163.238.35.144/~chi/CSC210/Univ09%20db.html
Click database schema on the University 09 Database web page to see the structure of this database.
To create the database, start the MySQL Command Line Client, using your password.
Type show databases to see what databases are already in your MySQL client.
Type create database univ09;
Type use univ09;
Click create database tables, select the entire text and copy it to the clipboard.
Go to the MySQL Command Line Client window, right click on it, and click paste.
This will create the tables in your database. To be certain that the tables are created,
Type show tables;
To load the tables with the sample data, click Data Files University 09 Database web page.
Save the text file which opens.
Next you need to split this file into six files without headers.
To do this, open the text file you saved with the windows notepad, (if you used Firefox instead of the IE to view the page,
you will need to open the file with the windows wordpad, as Firefox opens text files with the newline characters explicitly
included in the file), select each section one-by-one, and save them as person.txt, prof.txt, student.txt, course.txt,
section.txt, and repor.txt.
The files must be saved in the directory: C:\Documents and Settings\All Users\Application Data\MySQL\MySQL Server
5.1\data\univ09.
To load the tables into your database, click bulk load table on the University 09 Database web page.
Save the script which opens in a text file.
Open the file with the windows textpad, select the entire script and copy it to the clipboard.
Go to the MySQL Command Line Client window, right click on it, and click paste.
This will load the person table.
To load the remaining tables, change the script file to prof.txt and table prof, etc.
To check that your database is loaded properly, type show tables;
On the University 09 Database web page
In the MySQL Administrator, click Restore, click Open Backup File, navigate to the folder where you saved the file you
downloaded
The Query Browser will be used to do everything that you can do with the databases you will create.
For an example using MySQL
1) Find the numbers and names of all courses taken by at least one student who has taken CSC330
If your retrieval is empty, that is because our small test database contains insufficient data, so
run this SQL program to add a row to the report table:
insert into report
values ('987654321', '4164', 'S02', 'B')