How to Fix Incorrect format parameter error when importing large database in PHPMyAdmin?
This error appears when you import a big SQL file in phpMyAdmin. It is usually not a problem with the file, but with the limits of PHP on your server.
Common causes:
- The file is bigger than
upload_max_filesizeorpost_max_size. - The import takes longer than
max_execution_time. - The script needs more memory than
memory_limitallows.
Fix 1: compress the SQL file. phpMyAdmin can import a .zip or .gz file directly, and it is much smaller.
Fix 2: increase the limits in php.ini (or .user.ini), then restart the server.
upload_max_filesize = 256M
post_max_size = 256M
memory_limit = 512M
max_execution_time = 600
See how to increase the upload size and the execution time.
Fix 3: remove the phpMyAdmin time limit by adding this line in its config.inc.php file.
$cfg['ExecTimeLimit'] = 0;
Fix 4: import with the command line. This is the best way for very big files, because PHP limits do not apply.
mysql -u username -p database_name < backup.sql
Note:
Take a backup before you import into a database that already has data, because an import can overwrite tables. Splitting a big file into smaller parts also works.
Learn more about the similar topics:
| Tutorials |
|---|
| PHP MySQL Tutorial |
| PHP : MySQL Database |
| PHP : MySQL Connect |
| PHP : MySQL Create Database |
| PHP : MySQL Create Table |
| PHP : MySQL INSERT Statement |
| PHP : MySQL Select Data |
| Exercises & Assignments |
|---|
| Display MySQL data in an HTML table using mysqli_fetch_array() |