How to Load the Sample Database into MySQL Server

Step 1

Download the classicmodels database from the MySQL sample database section.

Step 2

Unzip the downloaded file into a temporary folder. You can use any folder you want. To make it simple, we will unzip the file to the C:\temp  folder.

If you use another operating system such as macOS, Linux, or Unix, please feel free to unzip it to any directory you like.

Step 3

Connect to the MySQL server using the mysql client program. The mysql program is located in the bin directory of the MySQL installation folder.

> mysql -u root -p
Enter password: ********

You will need to enter the password for the root user account to log in.

Step 4

Use the source command to load data into the MySQL Server:

mysql> source c:\temp\mysqlsampledatabase.sql

Step 5

Use the SHOW DATABASES command to list all databases in the current server:

mysql> show databases;

The output will look like the following that includes the newly created classicmodels database:

+--------------------+
| Database           |
+--------------------+
| classicmodels      |
| information_schema |
| mysql              |
| performance_schema |
| sys                |
+--------------------+
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

Install MySQL

Note that if you use other operating system platforms such as Linux and macOS, you use the following tutorial: Install MySQL 8 on CentOS 7 Install MySQL 8 on Ubuntu Download MySQL Installer...

Install MySQL on Ubuntu

  Step 1. Update package index Execute the following command to update the local packages index with the latest changes made in the repositories: sudo apt update Step 2. Upgrade packages Type...

Install MySQL CentOS

To install MySQL 8 on CentOS 7, you follow these steps: Step 1. Setup Yum repository Execute the following command to enable MySQL yum repository on CentOS: rpm -Uvh...

MySQL Sample Database

We use the classicmodels database as a MySQL sample database to help you work with MySQL quickly and effectively. The classicmodels database is a retailer of scale models of classic cars database....