Sakila data usage learning records and sakila data records

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.