To get a working sample database that you can play with, start by visiting the book’s web site and downloading the music database file music.sql from the sample databases section.
To load the file into your server, you need to use the
SOURCE command and specify where MySQL can
music.sql file. For
example, this might be ~/music.sql or ~/Desktop/music.sql
on a Linux or Mac OS X system, or C:\Documents and
Settings\my_windows_login_name\Desktop\music.sql on a
Once you run the
command, you should see some reassuring messages flash by:
path_to_music.sql_file; Query OK, 1 row affected (0.00 sec) Query OK, 1 row affected (0.01 sec) Query OK, 1 row affected (0.00 sec) ...
You can now see if the database is there by using the
SHOW DATABASES command:
SHOW DATABASES;+----------+ | Database | +----------+ | music | | mysql | | test | +----------+ 3 rows in set (0.00 sec)
We’ll see how to use this database in future chapters.
Repeat this process for the two additional sample database
files, flight.sql and
university.sql, that are available from the
book’s web site. Finally, you can leave the MySQL monitor by typing