[php] How to solve time out in phpmyadmin?

I want import huge (at least 300 mb) sql scripts via phpMyAdmin.

I've tried:

post_max_size = 750M
upload_max_filesize = 750M
max_execution_time = 300
max_input_time = 540
memory_limit = 1000M

in my php.ini file, but I'm still getting timeout errors during importing.

This question is related to php mysql phpmyadmin execution-time

The answer is


But if you are using Plesk, change your settings in :

/usr/local/psa/admin/htdocs/domains/databases/phpMyAdmin/libraries/config.default.php

Change $cfg['ExecTimeLimit'] = 300; to $cfg['ExecTimeLimit'] = 0;

And restart with Plesk UI or use:

/etc/init.d/psa restart and /etc/init.d/httpd restart


To increase the phpMyAdmin Session Timeout, open config.inc.php in the root phpMyAdmin directory and add this setting (anywhere).

$cfg['LoginCookieValidity'] = <your_new_timeout>;

Where is some number larger than 1800.

Note:

Always keep on mind that a short cookie lifetime is all well and good for the development server. So do not do this on your production server.

Reference


If even after repeated upload you still get timeout error, pleasechange your settings in

\phpmyadmin\libraries\config.default.php

from $cfg['ExecTimeLimit'] = 300; to $cfg['ExecTimeLimit'] = 0; and restart. Now there is no execution time limit (trust we are talking about local server).

Source : Change Script time out in phpmyadmin


I had this issue too and tried different memory expansion techniques I found on the web but had more troubles with it. I resolved to using the MySQL console source command, and of course you don't have to worry about phpMyAdmin or PHP maximum execution time and limits.

Syntax: source c:\path\to\dump_file.sql

Note: It's better to specify an absolute path to the dump file since the mysql working directory might not be known.


I'm using version 4.0.3 of MAMP along with phpmyadmin. The top of /Applications/MAMP/bin/phpMyAdmin/libraries/config.default.php reads:

DO NOT EDIT THIS FILE, EDIT config.inc.php INSTEAD !!!

Changing the following line in /Applications/MAMP/bin/phpMyAdmin/config.inc.php and restarting MAMP worked for me.

$cfg['ExecTimeLimit'] = 0;

I had the same issue and I used command line in order to import the SQL file. This method has 3 advantages:

  1. It is a very easy way by running only 1 command line
  2. It runs way faster
  3. It does not have limitation

If you want to do this just follow this 3 steps:

  1. Navigate to this path (i use wamp):

    C:\wamp\bin\mysql\mysql5.6.17\bin>

  2. Copy your sql file inside this path (ex file.sql)

  3. Run this command:

    mysql -u username -p database_name < file.sql

Note: if you already have your msql enviroment variable path set, you don't need to move your file.sql in the bin directory and you should only navigate to the path of the file.


None of the above answers solved it for me.

I cant even find the 'libraries' folder in my xampp - ubuntu also.

So, I simply restarted using the following commands:

sudo service apache2 restart

and

sudo service mysql restart
  • Just restarted apache and mysql. Logged in phpmyadmin again and it worked as usual.

Thanks me..!!


I was having the issue previously in XAMPP localhost with phpmyadmin version 4.2.11.

Increasing the timeout in php.ini didn't helped either.

Then I edited xampp\phpMyAdmin\libraries\config.default.php to change the value of $cfg['ExecTimeLimit'], which was 300 by default.

That solved my issue.


If any of you happen to use WAMP then at least in the current version (3.0.6 x64) there's a file located in <your-wamp-dir>\alias\phpmyadmin.conf which overrides some of your php.ini options.

Edit this part:

# To import big file you can increase values php_admin_value upload_max_filesize 512M php_admin_value post_max_size 512M php_admin_value max_execution_time 600 php_admin_value max_input_time 600


If using Cpanel/WHM the location of file config.default.php is under

/usr/local/cpanel/base/3rdparty/phpMyAdmin/libraries

and you should change the $cfg['ExecTimeLimit'] = 300; to $cfg['ExecTimeLimit'] = 0;


Examples related to php

I am receiving warning in Facebook Application using PHP SDK Pass PDO prepared statement to variables Parse error: syntax error, unexpected [ Preg_match backtrack error Removing "http://" from a string How do I hide the PHP explode delimiter from submitted form results? Problems with installation of Google App Engine SDK for php in OS X Laravel 4 with Sentry 2 add user to a group on Registration php & mysql query not echoing in html with tags? How do I show a message in the foreach loop?

Examples related to mysql

Implement specialization in ER diagram How to post query parameters with Axios? PHP with MySQL 8.0+ error: The server requested authentication method unknown to the client Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver' phpMyAdmin - Error > Incorrect format parameter? Authentication plugin 'caching_sha2_password' is not supported How to resolve Unable to load authentication plugin 'caching_sha2_password' issue Connection Java-MySql : Public Key Retrieval is not allowed How to grant all privileges to root user in MySQL 8.0 MySQL 8.0 - Client does not support authentication protocol requested by server; consider upgrading MySQL client

Examples related to phpmyadmin

phpMyAdmin on MySQL 8.0 phpmyadmin - count(): Parameter must be an array or an object that implements Countable Error loading MySQLdb Module 'Did you install mysqlclient or MySQL-python?' phpMyAdmin ERROR: mysqli_real_connect(): (HY000/1045): Access denied for user 'pma'@'localhost' (using password: NO) phpMyAdmin access denied for user 'root'@'localhost' (using password: NO) mysqli_real_connect(): (HY000/2002): No such file or directory How to create a foreign key in phpmyadmin #1292 - Incorrect date value: '0000-00-00' MySQL error - #1932 - Table 'phpmyadmin.pma user config' doesn't exist in engine phpMyAdmin Error: The mbstring extension is missing. Please check your PHP configuration

Examples related to execution-time

How to solve time out in phpmyadmin? How to increase maximum execution time in php Find out time it took for a python script to complete execution How do I get time of a Python program's execution? Maximum execution time in phpMyadmin calculating execution time in c++ What is the best way to measure execution time of a function? How do I time a method's execution in Java?