Mysql import. SQL file

Source: Internet
Author: User
Tags mysql import
Mysql import. SQL file-General Linux technology-Linux programming and kernel information. The following is a detailed description. Run the following command on the console:
Mysql-u username-p databasename use database_name
Run the following command:
Mysql> source 111. SQL
The default 111. SQL path must be placed in the bin of mysql.
Import successful !!!~~ Yeah ..
1. export the entire database
Mysqldump-u username-p database name> exported file name
Mysqldump-u wcnc-p smgp_rj_wcnc> wcnc. SQL
2. export a table
Mysqldump-u user name-p database name table name> exported file name
Mysqldump-u wcnc-p smgp_rj_wcnc users> wcnc_users. SQL
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 adds a drop table before each create statement.
4. import the database
Common source commands
Go to the mysql database console,
For example, mysql-u root-p
Mysql> use database
Then run the source Command. the following parameter is the script File (for example,. SQL used here)
Mysql> source d: \ wcnc_db. SQL
Reproduced in http://linux.chinaunix.net/techd... 06/06/1116903.shtml
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.