简体   繁体   English

如何在MySQL中导出400万数据?

[英]How to export 4 million data in MySQL?

I have a database with one particular table having more than 4 million record entries. 我有一个数据库,其中一个特定的表具有超过400万条记录条目。 I tried downloading whole db it using MySQL workbench as well as command terminal using following command: 我尝试使用MySQL工作台以及使用以下命令的命令终端下载整个数据库:

mysqldump -u root -p password mydb > myfile.sql

But, I got only half of the data downloaded. 但是,我只下载了一半的数据。 If I ignored that one particular table, then it's working fine. 如果我忽略了那个特定的表,那么它工作正常。 Can anyone suggest me how to download db with tables having more than million entries? 谁能建议我如何下载具有超过一百万个条目的表的数据库?

Try adding the below lines in the my.cnf and restart 尝试在my.cnf中添加以下行,然后重新启动

[mysqld]
# Performance settings used for import.
delay_key_write=ALL
bulk_insert_buffer_size=256M

or 要么

mysqldump -u root -p --max_allowed_packet=1073741824 --lock-tables=false mydb > myfile.sql

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM