Use mysqldump for Mysql backup _ MySQL

Source: Internet
Author: User
Use mysqldump for Mysql backup mysqldump

1. mysqldump command

Mysql mysqldump is used for MySQL database export. The basic usage is as follows:

Shell> mysqldump [OPTIONS] database [tables]

If you do not specify any tables, the entire database will be exported.

Run mysqldump -- help to obtain the option table supported by your mysqldump version.

Note: If you run mysqldump without the -- quick or -- opt option, mysqldump loads the entire result set to the memory before the export result. if you are exporting a large database, this may be a problem.

1.1. mysqldump supports the following options:

-- Add-locks

Add lock tables and unlock table before each TABLE is exported. (To make it faster to insert data to MySQL ).

-- Add-drop-table

Add a drop table before each create statement.

-- Allow-keywords

Names of columns allowed to be created as keywords. This is done by the table name prefix on each column name.

-C, -- complete-insert

Use the complete insert statement (with the column name ).

-C, -- compress

If both the client and server support compression, all information is compressed between the two.

-- Delayed

Use the insert delayed command to INSERT rows.

-E, -- extended-insert

Use the new multiline INSERT syntax. (A more compact and faster insert statement is provided)

-#, -- Debug [= option_string]

Tracking program usage (for debugging ).

-- Help

Displays a help message and exits.

LOAD DATA INFILE

-- Fields-terminated-by =...

-- Fields-enclosed-by =...

-- Fields-optionally-enclosed-by =...

-- Fields-escaped-by =...

-- Fields-terminated-by =...

These options are used with-T options and have the same meaning as the load data infile clause.

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.