World Setup en
World Setup en
The world.sql file contains sample data for a world database that you can play with. You can download this file from ht-
tp://dev.mysql.com/doc/.
The sample data used in the world database is Copyright Statistics Finland, http://www.stat.fi/worldinfigures.
To load the contents of the world.sql file into MySQL, use the following procedure:
If your current directory is not the same as the location of the world.sql file, use a cd command to change location.
This command connects to the server using the MySQL root account to make sure that you'll have permission to create the
world database. The --p option tells mysql to prompt you for the root password. Enter the password when prompted.
(Remember that the MySQL root account is not the same as the operating system root account and probably will have a differ-
ent password.)
Issue a SOURCE command to tell mysql to read and process the contents of world.sql:
mysql> SOURCE world.sql;
You'll see quite a bit of output as mysql reads queries from the world.sql file and executes them.
After mysql finishes processing the world.sql file, try this statement:
mysql> SHOW TABLES;
+-----------------+
| Tables_in_world |
+-----------------+
| City |
| Country |
| CountryLanguage |
+-----------------+
The output should list all three of the tables shown. Depending on your server configuration, SHOW TABLES may display the table
names in lowercase. If so, use lowercase names whenever you refer to the tables by name later.
To see what columns each table contains, use DESCRIBE. For example:
1
Setting Up the world Database