Import and export operation of MySQL database under Linux

Source: Internet
Author: User

1. Import the database

At the command line, enter:

Mysql-u username-p Test 

Description: Username is the database user name, test for the target database, enter the database password, the import operation!


Mysql>use test;
Mysql>set names UTF8;

Mysql>source D:/www/sql/back.sql;



2. Export the database

2.1. Export the entire database:

Mysqldump-u username-p Test >/home/data/test.sql

Description: Username is the database user name, test source database, enter the database password, the import operation! Destination file path is/home/data/

2.2. Export a table in the database:

Mysqldump-u username-p Test Documents >/home/data/test.sql

Description: Exports the documents table from the database test to the destination directory.





Import and export operation of MySQL database under Linux

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.