Search code examples
terminalmysql-workbenchmysqlsqlyog

How to export 4 million data in MySQL?


I have a database with one particular table having more than 4 million record entries. I tried downloading whole db it using MySQL workbench as well as command terminal using following command:

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?


Solution

  • Try adding the below lines in the my.cnf and restart

    [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