Share This

Tuesday, June 26, 2012

Common Errors Importing DataBases in phpMyAdmin

If you have just installed XAMPP or WAMPP and going to use a vanilla phpMyAdmin, there are a few things you need to configure before you do something with the DataBase (especially when uploading / importing data to MySQL) and you might face some issues or errors as described below which are common to every novice.



Warning: POST Content-Length of xxxxxxxx bytes exceeds the limit of xxxxxxx bytes
You probably tried to upload a file that is too large. Please refer to documentation for a workaround for this limit.


in php.ini, modify
post_max_size=8M
to
post_max_size=128M

(or)
in .htaccess, modify or insert one if it doesn't exist,
php_value post_max_size 128M

Note: It's also recommended to have the file compressed (gzip, bzip2, zip) before the upload.


No data was received to import. Either no file name was submitted, or the file size exceeded the maximum size permitted by your PHP configuration.

in php.ini, modify
upload_max_filesize=2M
to
upload_max_filesize=100M

(or)
in .htaccess, modify or insert one if it doesn't exist,
php_value upload_max_filesize 100M

After finish restarting Apache or reloading phpMyAdmin, you should see the Max file size as described below,



Fatal error: Maximum execution time of 300 seconds exceeded

in phpMyAdmin\config.inc.php, insert
$cfg['ExecTimeLimit'] = 36000;

(or)
in phpMyAdmin\libraries\config.default.php, modify
/* maximum execution time in seconds (0 for no limit) */
$cfg['ExecTimeLimit'] = 300;
to
$cfg['ExecTimeLimit'] = 36000;

(or)
in php.ini, modify
max_execution_time=30
to
max_execution_time=36000

(or)
in .htaccess, modify or insert one if it doesn't exist,
php_value max_execution_time 36000

Note: one shall try giving it 0 (for no limit) if it's not on production server.

Conclusion


Modifying phpMyAdmin\config.inc.php or phpMyAdmin\libraries\config.default.php

$cfg['ExecTimeLimit'] = 36000;
$cfg['LoginCookieValidity'] = 36000; // In seconds 
$cfg['MaxRows'] = 100; // Number of rows displayed browsing each table, default is 30

Modifying the php.ini file

post_max_size=128M
upload_max_filesize=100M
memory_limit=300M
max_execution_time=36000
max_input_time=36000
session.gc_maxlifetime=1200

Modifying the .htaccess file

<ifmodule mod_php5.c=""># mod_php5/mod_php4
php_value post_max_size 128M
php_value upload_max_filesize 100M
php_value memory_limit 300M
php_value max_execution_time 36000
php_value max_input_time 36000
php_value session.gc_maxlifetime 1200
</ifmodule>

I'd like to recommend the below article worth a reading,
http://www.webdevelopment2.com/importing-large-mysql-databases-when-phpmyadmin-lets-you-down-get-bigdump/

No comments:

Post a Comment