Use of the Mysqldump-extended-insert parameter

Source: Internet
Author: User


Mysqldump--extended-insert means long insert, multiple row together batch insert, improve the import efficiency, and do not turn on-e backup import time is at least 3, 4 times times, the default open; with--extended-insert= False to close. It is highly recommended to open,


Use--extended-insert=false to export a table like this, one INSERT statement per line.

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M00/83/BE/wKioL1d7ZkrQSREYAABEgooZSs4357.png "title=" 2.png " Style= "Float:none;" alt= "Wkiol1d7zkrqsreyaabegoozss4357.png"/>

Use--extended-insert=true to export a table like this, a very long insert statement.

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M01/83/BE/wKioL1d7Zo-T52crAAAyVmvjsmM570.png "title=" 3.png " alt= "Wkiol1d7zo-t52craaayvmvjsmm570.png"/>


is a two-way export database, you can see--extended-insert=true time, less time-consuming. Because my library is very small, the two methods are not obvious in comparison.

For large databases, the 2-way gap is still very large. Fortunately, the default mysqldump is to enable the--extended-insert=true parameter.

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M02/83/BF/wKiom1d7ZkrwSUZiAAAjh59gbtI452.png "style=" float: none; "title=" 1.png "alt=" Wkiom1d7zkrwsuziaaajh59gbti452.png "/>



In addition to exporting the database This parameter will have an impact, when the import is also affected. See directly:

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M02/83/C0/wKiom1d7arDzh07OAAAqCQlDncw770.png "title=" 4.png " alt= "Wkiom1d7ardzh07oaaaqcqldncw770.png"/>



Is it useless to use--extended-insert=false to export the table?

Not so. For example, the table in the database already has a large amount of data, then import data into the table, if there is a primary key data conflict duplicate key error, will cause the import operation failed, but at this time if you are using--extended-insert=false export table, Primary key conflict on Import error duplicate key error, but non-conflicting data will still be imported normally. "Personal feeling this does not often occur, because each time we export is the plus-b parameter, the export SQL statement has a drop TABLE IF EXISTS ' TABLE1 ';"



Reference Blog: http://blog.csdn.net/hw_libo/article/details/39583247


Use of the Mysqldump-extended-insert parameter

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.