Sakila data usage learning records and sakila data records
Import sakila Database
- Download the sakila database and see the sakila-data. SQL data file and sakila-schema file.
- Create database sakila on the database;
- Use sakila and use the source command
- Pilot mode file source e:/sqldata/sakila-db/sakila-schema. SQL;
- Then import the data file source e:/sqldata/sakila-db/sakila-data. SQL;
- Select count (*) from custormer; if hundreds of records are displayed, the import is successful.
SQL File Import and Export
1. Export an SQL script
Mysqldump-u username-p Database Name> storage location
Mysqldump-u root-p test> c:/a. SQL
2. Import an SQL script
Mysql-u username-p database name <storage location
Mysqljump-u root-p test <c:/a. SQL
Note: The test database must already exist.
Use Cases for MySQL Export Import commands
3. Export a database structure
Mysqldump-u wcnc-p-d-add-drop-table smgp_apps_wcnc> d: wcnc_db. SQL
-D no data-add-drop-table add a drop table before each create statement