Why does this happen?
A .sql file is a text file that holds a copy of a database. phpMyAdmin is a web tool for managing databases. When you import a file, it must upload through your browser first.
PHP, the language phpMyAdmin runs on, has size limits. Common limits are upload_max_filesize, post_max_size and max_execution_time. If the file is bigger than a limit, the import fails. You may see "file is too big" or a timeout message.
Take a backup of your current database before you import. An import can overwrite data.
Fix 1: Raise the PHP limits in cPanel
- Log in to cPanel.
- Open MultiPHP INI Editor in the Software section.
- Pick your domain, or use the editor in basic mode.
- Raise
upload_max_filesizeandpost_max_sizeto more than your file size. - Raise
max_execution_timeandmemory_limitif needed. - Click Apply.
- Try the import again.
Some hosting plans limit what you can raise. Ask Hostvento support if the values will not change.
Fix 2: Compress the file
- Zip or gzip the .sql file on your computer.
- In phpMyAdmin, choose the database and click Import.
- Pick the compressed file. phpMyAdmin can read .zip and .gz files.
Text files shrink a lot, so this often works.
Fix 3: Split the file
You can cut a huge file into smaller pieces using a free tool such as a SQL splitter. Import each piece one by one, in order.
Fix 4: Use the command line (SSH)
SSH lets you type commands on your server. Upload the file with FTP first, then run:
mysql -u db_user -p db_name < backup.sql
This reads the file straight into the database. Replace db_user, db_name and backup.sql with your own values. It will ask for the password. SSH access depends on your plan, so ask support if you do not have it.
Fix 5: Use the Import tool from a script
Some tools import big files in small pieces and avoid time limits. Ask support if you want help choosing one.
Quick recap
- The error comes from PHP upload and time limits.
- Raise limits in MultiPHP INI Editor.
- Compress or split the file.
- For very big files, import with the
mysqlcommand over SSH. - Always back up first.