MySQL database import and Export

Source: Internet
Author: User
Tags import database

1, export the entire database     MYSQLDUMP-U user name-p database name > storage location     such as:    Mysqldump-u root-p Project > c:/a.sql            (export project database has been tested in person, success!) )  2. Export the structure of a table with data in the table     MYSQLDUMP-U user name-p  database name   Table name > exported file name     Mysqldump-u Root -P project  Position > c:/a.sql            (test, Success!)   Export only table structure without data in table:    mysqldump -d -u root-p project  position > c:/a.sql            (test, Success!) )   3. Export a database structure     Mysqldump-u wcnc-p-D--add-drop-table smgp_apps_wcnc >d:wcnc_db.sql  & nbsp -D No data--add-drop-table add a drop table 4 before each CREATE statement. Import Database     1, Common source command     go to MySQL database console ,        d:/program files/mysql/mysql server 5.1/bin > Mysql-u root-p        D:/program files/mysql/mysql Server 5.1/bin > Mysql>use ' database '     Then use the source command, followed by the script file (as used here. sql)         d:/program files/mysql/mysql server 5.1/bin > Mysql>source d:wcnc_db.sql    2, mysql-uroot-p (password) database name Table name < imported file name  5. The remote Export Database command is as follows:    Mys qldump-h  192.168.11.210 -u  root -p  test>c:/test.sql

MySQL database import and export

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.