How to install the sample database sakila in MySQL

Like the SQLServer sample database, MySQL has sample databases such as sakila; the Sakila database was originally developed by Mike Hillyer, a former member of the MySQL AB documentation team, to provide a standard schema that can be used for examples in books, tutorials, articles, samples, etc. , which contains sample views, stored procedures, and triggers.

Following are the instructions for installing the sakila database on the server, as well as the schema of the sakila database. The downloaded sakila documentation contains three files: sakila-schema.sql, sakila-data.sql, and sakila.mwb.

The sakila-schema.sql file contains all the CREATE statements needed to create the sakila database schema, including tables, views, stored procedures, and triggers.

The sakila-data.sql file contains the INSERT statements needed to populate the structures created by the sakila-schema.sql file, as well as definitions for triggers that must be created after the initial data load.

The sakila.mwb file is a MySQL Workbench data model, you can open it in MySQL Workbench to inspect the database structure.

To install the Sakila sample database, perform the following steps:

1. Extract the installation archive to a temporary location. When you unzip the archive, it creates a directory called sakila-db that contains the sakila-schema.sql and sakila-data.sql files.

2. Use the following command to connect to the MySQL server using the MySQL command line client:

$> mysql -u root -p

Enter your password when prompted. Can use non-root account &

Guess you like

Origin blog.csdn.net/wyxtx/article/details/131706079