Example HTML page

Loading Sample Database

Loading the sample Database in to MySQL Database Server

In this topic, I am going to explain how to load a sample database in to the MySQL Database Server. Before, going in to the concept consider a sample database which contains tables,views, triggers etc.

I will show you two ways to load the sample database in to the MySQL Server. Some times this process is also called as ‘dumping’

  1. From MySQL Yog
  2. From MySQL Command Prompt.

1. From MySQL Yog

To load the database using this method, first check whether the MySQL Yog is installed in your system or not. If not, Better to Install the software first. I have shown few screenshots to understand the concept easily.

First Download the SQL Database file from the following link;


I have attached the drive link to download the other database in future. In the list of all the database select the ‘classicmodels.sql’ and Download it. But for this case just click download option and Save this file in your local directory.

I saved the file in the following path :


Here sampledatabases is the folder name in which i am storing this ‘sql’ file.


Now Open MySQL Yog.



On the left hand side, you may view all the existing databases that are available in MySQL Database Server.

Click on Restore from SQL Dump (Short Cut key: Ctrl+Shift+Q). One window will be displayed as shown below.

Click Browse and select the “.sql” file, from the location where you saved the file in the above path earlier.

Once, you select the file, now you will get the window similar to the one, shown below.

Click on the “Execute” Button.

Press “F5” in the MySQL Yog or “right click on the mouse” and Select Refresh as shown below.

Now you can observe the “classic models” database is added to the list of available databases.

2. From MySQL Prompt

The other way, you can import the sample database in the MySQL Prompt with the help of “Source” command. 

Open the MySQL Terminal and give the password. To launch the MySQL Command Prompt you may visit my other post Database Server Connection

First, Observe the list of databases that are available in the MySQL database server using:

‘show databases’

From the above screen, you may observe that “classic models” is available, since we have already imported in ‘MySQL Yog’. Drop the database as shown in the following screen.  Now i am using the following command and again showing the list of available databases.

Now use source command as given below.


source path-of-the-file


source E:\MySQL\sampledatabases\classicmodels.sql

But One point to remember here is change the backward slash to forward slash and execute the command.

The above command changed to

source E:/MySQL/sampledatabases/classicmodels.sql

When you execute the above command, MySQL server process the command and the database is now imported in to the Database Server.

You can view the same by using – show databases command.

Now let us observe, the contents in the ‘classicmodels‘ database.

To use this database, you have to use the ‘use database-name’ command. After that you view the list of table using ‘show tables’ command.

Now you can view the data in each table with ‘select’ statement.

Ex: select * from customers;

Example HTML page

Leave a Reply

Your email address will not be published. Required fields are marked *

Pin It on Pinterest