phpMyAdmin import database 500 error? 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

MariaDB backup commands▼

mariadb-dump -u root -p[root_password] [database_name] > dumpfilename.sql

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

MariaDB import command▼

mariadb-dump -u root -p[root密码] [数据库名称] < dumpfilename.sql

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 ▼

Comment

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

Scroll to Top