Summary of mysql database backup and Restoration

Source: Internet
Author: User
Tags mysql commands
Welcome to the Linux community forum, interact with 2 million technical staff to enter the second do not log on to mysql with mysqldump command export file, the feeling is similar to the backup database, the command is as follows: mysqldump-Tpathdbnametable_name-uroot-ppath for export path, dbname is the table name in the database.

Welcome to the Linux community forum and interact with 2 million technical staff> log on to mysql and use the mysqldump command to export files. The command is similar to the backup database. The command is as follows: mysqldump-T path dbname table_name-u root-p path is the export path, and dbname is the database name table_name is the table name in the database.

Welcome to the Linux community forum and interact with 2 million technicians>

2. Do not log on to mysql

Using the mysqldump command to export files is similar to backing up a database. The command is as follows:

Mysqldump-T path dbname table_name-u root-p

Path is the export path, and dbname is the database name table_name is the table name in the database.

It can also be like select... The options for adding option to into outfile are as follows:

Mysqldump-T path dbname table_name-u root-p -- fields-terminated-by =, -- fields-enclosed-by = \ "-- fields-escaped-by =? -- Lines-terminated-by = \ r \ n

Use mysql commands to export Databases

Mysql-u root-p -- execute = "select statement" dbname> filename.txt

You can also use mysql to export html data and use the -- html option.

Mysql-u root-p -- html -- execute = "select statement" dbname> filename.html

Mysql-u root-p -- xml -- execute = "select statement" dbname> filename. xml

Use mysqlimport to import text files

Mysqlimport-u root-p db_name filename.txt

You can also include optional parameters such as mysqldump.

Mysqlimport-u root-p db_name filename.txt -- fields-terminated-by =, -- fields-enclosed-by = \ "-- fields-escaped-by =? -- Lines-terminated-by = \ r \ n

[1] [2]

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.