Skip to content

Importing a large database

phpMyAdmin on Ruachost hosting can import files up to 512 MB. Larger files, or very large imports that take a long time, can fail with “file too large”, a timeout, or “MySQL server has gone away”. Try these options in order.

phpMyAdmin imports compressed files directly, and database exports compress very well, often to a tenth of their size.

  • Compress your .sql file as .sql.gz (gzip) or .zip.
  • On Windows, use 7-Zip and choose gzip. On macOS or Linux, run gzip yourfile.sql.
  • Import the compressed file in phpMyAdmin’s Import tab as normal.

Exporting from another phpMyAdmin? Choose Custom export and set Compression to gzipped.

Use a free tool such as SQLDumpSplitter or BigDump to split the .sql file into smaller parts, then import the parts one at a time, in order.

If SSH is enabled for your account, the command line has no file-size limit and is the fastest option:

  1. Upload the file to your home directory (not public_html) with FTP or File Manager.
  2. Connect with SSH and run:
Terminal window
mysql -u cpuser_dbuser -p cpuser_dbname < yourfile.sql

For a compressed file:

Terminal window
gunzip < yourfile.sql.gz | mysql -u cpuser_dbuser -p cpuser_dbname

Replace the user and database names with your own, and enter the database user’s password when asked. See Importing and exporting a MySQL database.

Open a support ticket. Upload the file to your home directory first, and tell us its name and which database to import it into. We’ll import it for you.

  • Create the database and user first in cPanel’s Manage My Databases. See Managing MySQL databases and users.
  • Remove CREATE DATABASE and USE lines from the file if it was exported from another host. On shared hosting, database names must start with your cPanel username, so import into the database you created.
  • “Access denied; you need the SUPER privilege”? The file contains DEFINER statements. See Troubleshooting MySQL definer issues.
  • Moving from another cPanel host? We’ll move your whole website, including databases, for free. See Moving your website to Ruachost.