Site icon TestingDocs.com

Setup MySQL world Database

Overview

This tutorial is a step-to-step guide to setup the MySQL world Database and the tables in the schema. The world sample sample database is an example database from MySQL team.

Download world Database

Download the MySQL script file that contains the SQL statements. To download the database navigate to the following URL:

https://dev.mysql.com/doc/index-other.html

In the Example Databases section, click on world database download links. The download is available in two formats.

On Windows Operating system click on the Zip download link.

On  Linux distributions click on the TGZ download link.

 

 

Extract Contents

Extract the contents of the world-db zip file. Copy the world.sql file to a suitable location.

Connect to the MySQL server using the mysql command-line client::

$> mysql -u root -p

Enter the root password. We can also use a non-root user account. The user account should have privileges to create new database. To know more about the MySQL command line client:

https://www.testingdocs.com/mysql-command-line-client/

Install Database

Execute the world.sql SQL script file to create the database structure and insert the data. In this example, the world.sql file is located at following location :

C:/TestingDocs/world.sql

Issue the following command at the MySQL command prompt.

mysql> SOURCE C:/TestingDocs/world.sql;

Press the Enter button to execute the command.

 

 

The database and the tables would be installed. To confirm we can use the following command to know the tables:

mysql> SHOW TABLES;

MySQL world tables

https://www.testingdocs.com/mysql-world-database-tables/

MySQL Tutorials

MySQL Tutorials on this website:

https://www.testingdocs.com/mysql-tutorials-for-beginners/

For more information on MySQL Database:

https://www.mysql.com/

Exit mobile version