Import database 500 error? Linux export MySQL large file command line

someone engaged inE-commerceFriends of the industry, justInstall the VestaCP panelAfter that, want to passphpMyAdmindatabase management importMySQL database, there have been 500 errors, and the import failed after trying many times...

Maybe because of php.ini configuration, or other problems, so export or import in phpMyAdminMySQLThe large file takes too long, and the php timeout causes the export or import to fail...

Even if the modification improves the memory configuration of the related files, it will not help...

At this point, we can pass Linux Command line implementation:

  • Use MySQL backup command line to quickly export MySQL database;
  • Use the MySQL import command line to quickly import MySQL databases.

MySQL export database command

MySQL Backup Commands ▼

mysqldump -u root -p[root_password] [database_name] > dumpfilename.sql
  • command does not include symbols []
  • Please change "dumpfilename" to your MySQL database file name.
  • Note the right arrow > is export.

Extract the .gz MySQL database file

If your MySQL database file is compressed with a .gz suffix, it cannot be imported into the database via the SSH command line.

Before running the command to import the MySQL database, please enter the following .gz unzip command to unzip ▼

gunzip FileName.gz
  • Please change "FileName" to the name of your MySQL database archive, for example: xxx.sql.gz

MySQL import database command

MySQL import command ▼

mysql -u root -p[root密码] [数据库名称] < dumpfilename.sql
  • command does not include symbols []
  • Please change "dumpfilename" to your MySQL database file name.
  • Note the left arrow < is import.

More SSH commands for Linux systems can be found here ▼

Hope Chen Weiliang Blog ( https://www.chenweiliang.com/ ) shared "Import database 500 error? Linux Export MySQL Large File Command Line" to help you.

Welcome to share the link of this article:https://www.chenweiliang.com/cwl-707.html

Welcome to the Telegram channel of Chen Weiliang's blog to get the latest updates!

🔔 Be the first to get the valuable "ChatGPT Content Marketing AI Tool Usage Guide" in the channel top directory! 🌟
📚 This guide contains huge value, 🌟This is a rare opportunity, don’t miss it! ⏰⌛💨
Share and like if you like!
Your sharing and likes are our continuous motivation!

 

Comment

Your email address will not be published. Required fields * Callout

scroll to top