How to Fix Incorrect format parameter error when importing large database in PHPMyAdmin?

Are you getting Incorrect format parameter error in PHPMyAdmin while importing the database? Most of the time this error is encountered when a user imports a large database file.

Common Reason for “Incorrect format parameter” error:

  • The maximum execution time exceeded in PHP for current file/script/action
  • You are uploading maximum upload file size defined for PHP scripts
  • the post request of the uploaded file has exceeded defined maximum size in PHP
  • You have exceeded the maximum amount of memory that a PHP script is allowed to allocate

Therefore, the fix can be made using the PHP configuration file by increasing the limit.

Fix 1: Compress SQL file

If the issue is related to large file size, the easy way is to compress the SQL file (into .zip) before uploading. PHPMyAdmin supports compressed file import directly.

This is also useful If your server does not allow you to change PHP configuration. The compressed file name should look like

Fix 2: Increase Size in PHP Config

Change or Adjust the PHP Configuration setting according to your file upload size and approximate execution time required. Here is an example to increase the limit using php.ini file.

max_execution_time = 600
max_input_time = 300
memory_limit = 256M
post_max_size = 300M
upload_max_filesize = 300M

Note: You can also try setting as maximum as possible but remember to revert it after work is done.

Fix 3: Directly run using SQL tab:

You can directly copy all data from your sql file into SQL tab and Click on the “Go” button to run all queries. However, this option is less likely to succeed if data is large and exceed default maximum execution time in PHP.

Fix 4: Using Command Line:

If your database file is not in MB but in GB, you may need to use the command line to import it. Here is the sample command:

mysql -u root -p db-name < db-file.sql

Most Hosting control panel also provides SSH access for similar commands on server.

Learn more about the similar topics:
No Content Found.
Exercises & Assignments
No Content Found.
Interview Questions & Answers
No Content Found.