How to install Classic Models sample database


Sometimes we need to setup a database only to test our implementations. In those cases, it’s useful to have a sample database installed in our MySQL Server (In my case: SuSE Linux Enterprise 11).

Classic Models is open source sample database. It means we are free to use it to experiment with other tools, to create samples for other tools, etc. The sample database is provided under the terms Eclipse.org Software User Agreement. For further information, please visit:

 http://eclipse.org/birt/documentation/sample-database.php

As they say:

The database represents a fictitious company: Classic Models Inc. which buys collectable model cars, trains, trucks, buses, trains and ships directly from manufacturers and sells them to distributors across the globe.

You can read more in: Classic Models Definition

Schema

The database consists of eight tables:

Table name Description
Offices Sales offices
Employees All employees, including sales reps who work with customers
Customers
Orders Orders placed by customers
Order Details Line items within an order
Payments Payments made by customers against their account
Products The list of scale model cars
Product Lines The list of product line classifcation

This ER-diagram shows the table structure and relationships. (PDF version)

ClassicModelsDBSchema 

Install

1) Download the zip file containing the MySQL database scripts.

2) Expand the zip file into a convenient location, for instance /tmp/.

3) Go to the /ClassicModels/mysql directory:

4) Start the mysql utility, for example, to use the default root user:

Enter your password when prompted.

5)Create the ClassicModels database

You should see something like:

6) “Open” the created Database

Your should see:

7) Load the schema.

Loading the schema the schema the first time will give error messages as it attempts to empty any existing tables, just ignore these.

8) Load the table contents:

If all went well:

9) Exit from mysql:

And that’s all. We have the Classic Models database installed and ready to be used.

Troubleshooting

A) COMMAND NOT ALLOWED

If you got the following message:

probably you have a security issue.

Try to logout and login again with the following command:

For further information about Security Issues with LOAD DATA LOCAL:

http://dev.mysql.com/doc/refman/5.5/en/load-data-local.html

 B) FILE NOT FOUND

If the mysql shell can’t find a file, you will get this:

Linux is case-sensitive. So, Customer.txt IS NOT EQUAL customer.txt

I don’t understand why the creators of this great sample database have named Customer.txt (to the files) and wrote customer.txt in the script.

A possible solution is to modify the script or modify the file’s names. As you wish!

 

Share and Enjoy

  • Facebook
  • Twitter
  • Delicious
  • LinkedIn
  • StumbleUpon
  • Add to favorites
  • Email
  • RSS