Mysqldump Import and export detailed

Source: Internet
Author: User
Tags mysql command line


Mysqldump can specify the path, if the path is not specified, but only the file name, then the current access to the MySQL command line in the directory, which is the MySQL installation directory
mysqldump--default-character-set=utf8-h127.0.0.1-uroot-pabctrans-p33061 db table1 able2 |gzip > db ' Date +%y%m%d ' . tar.gz

mysqldump--default-character-set=utf8-h127.0.0.1-uroot-pabctrans-p33061 db table1 able2 |gzip > db ' Date +%y%m%d ' . tar.gz
Zcat .... gz | Mysql-h127.0.0.1-uuser-ppass DB
--max_allowed_packet=1024m

Add-f parameter, can ignore the operation is an exception, or an exception will be exited
Tar-tvzf db20121116.tar.gz
Can't see the zipped files inside?

This is not a tar bag.
Zcat dzhweibotmp120121116.tar.gz | More enter to see the next part, Q key exit
--add-drop-table=false

Mysqldump--help|grep Drop
--add-drop-database add a drop database before each create.
--add-drop-table Add a drop table before each create.
Options--skip-add-drop-table--skip-add-locks
--opt same as--add-drop-table,--add-locks,--create-options,
--skip-opt Disable--opt. Disables--add-drop-table,--add-locks,
Add-drop-database FALSE
Add-drop-table TRUE
This is some help by default is to turn on delete

SQL command is the first drop, after the establishment of the table structure, for the table with data to do import operations, it is very dangerous! Be sure to pay attention!
Good

--no-create-info
Adding this will not delete and CREATE TABLE statements.

--add-drop-table=false
This parameter simply does not have a delete table statement, but there is a basic usage of creating a table statement cnblogs-mysqldump backup Restore and mysqldump Import Export statement cnblogs-mysql mysqldump tool

Mysqldump Import and export detailed

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.