Setup mySql and install some textbook databases on your machine
I assiume that you are running XAMPP on Windows; the steps are similar for other setups
- Download the "small databases" ZIP file (linked from schedule page) to your computer;
- extract the three
.sql files
(simpsons, world, and imdb_small)
- Make sure that
mySQL is running on your system (XAMPP control panel)
- In a web browser, go to
localhost/phpmyadmin
(on some systems, phpMyAdmin)
-
It is recommended that you create a password for the root account
(I'm not sure how to recover your data if you ever forget the password)
- In phpmyadmin, click the
Users tab at the top.
- Find the row that has User root and Host 127.0.0.1
- Click
Edit Privileges
- Click
Change password
-
Enter the password twice (write it down somewhere if you're not sure you can remember it)
-
Click the
Gobutton
-
Repeat this process for
root at localhost, using the same password
-
At this point you may not be able to connect to phpmyadmin.
Go to the C:\xampp\phpMyAdmin the folder, edit the file config.inc.php
(on some systems it is called config.default.php),
to set $cfg['Servers'][$i]['password'] = 'yourrootpassword';.
Note: if you use Notepad to edit this file, it may appear to be all on one line.
I recommend that you use a better editor, such as Notepad++ or Eclipse.
- You should now be able to connect to
phpmyadmin again.
- Click
Databases tab at the top of the page.
- Under
Create Database, type simpsons for the name, choose utf8_general_ci for the collation, and click the Create button
- Do the same for
world and imdb_small
- Populate the
simpsons database:
- In the left column (Navigation frame), click
simpsons
- Click
Import from the top of the page, then click Chhose File
- Browse to where you extracted the files in step 1, then choose
simpsons.sql
- Click
Go
- You should see the four table names (courses, grades, students, teachers) in the left column
- Click one of those names to see its contents
- Repeat the previous step for
world and imdb_small databases
- You should now be ready to do some queries:
Choose the simpsons database again and click the Query Window icon
at the top of the Navigation Frame