php 如何解决phpmyadmin超时?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/16707532/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to solve time out in phpmyadmin?
提问by user1811486
I want import huge (at least300 mb) sql scripts via phpMyAdmin.
我想通过 phpMyAdmin导入巨大的(至少300 mb)sql 脚本。
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 stillgetting timeout errors during importing.
在我的php.ini
文件中,但我在导入过程中仍然遇到超时错误。
回答by jahajee.com
If even after repeated upload you still get timeout error, pleasechange your settings in
如果即使在重复上传后仍然出现超时错误,请更改您的设置
\phpmyadmin\libraries\config.default.php
\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).
从$cfg['ExecTimeLimit'] = 300;
到$cfg['ExecTimeLimit'] = 0;
并重新启动。现在没有执行时间限制(相信我们说的是本地服务器)。
Source : Change Script time out in phpmyadmin
回答by paulalexandru
I had the same issue and I used command line in order to import the SQL file. This method has 3 advantages:
我遇到了同样的问题,我使用命令行来导入 SQL 文件。这种方法有3个优点:
- It is a very easy way by running only 1 command line
- It runs way faster
- It does not have limitation
- 仅运行 1 个命令行,这是一种非常简单的方法
- 它运行得更快
- 它没有限制
If you want to do this just follow this 3 steps:
如果您想这样做,只需按照以下 3 个步骤操作:
Navigate to this path (i use wamp):
C:\wamp\bin\mysql\mysql5.6.17\bin>
Copy your sql file inside this path (ex file.sql)
Run this command:
mysql -u username -p database_name < file.sql
导航到此路径(我使用 wamp):
C:\wamp\bin\mysql\mysql5.6.17\bin>
在此路径中复制您的 sql 文件(例如 file.sql)
运行此命令:
mysql -u 用户名 -p 数据库名 <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.
注意:如果您已经设置了 msql 环境变量路径,则不需要将 file.sql 移动到 bin 目录中,您应该只导航到文件的路径。
回答by chuchunaku
I'm using version 4.0.3 of MAMP along with phpmyadmin. The top of /Applications/MAMP/bin/phpMyAdmin/libraries/config.default.php reads:
我正在使用 MAMP 4.0.3 版和 phpmyadmin。/Applications/MAMP/bin/phpMyAdmin/libraries/config.default.php 的顶部显示:
DO NOT EDIT THIS FILE, EDIT config.inc.php INSTEAD !!!
不要编辑这个文件,而是编辑 config.inc.php !!!
Changing the following line in /Applications/MAMP/bin/phpMyAdmin/config.inc.php and restarting MAMP worked for me.
更改 /Applications/MAMP/bin/phpMyAdmin/config.inc.php 中的以下行并重新启动 MAMP 对我有用。
$cfg['ExecTimeLimit'] = 0;
回答by DanX
But if you are using Plesk, change your settings in :
但如果您使用的是 Plesk,请更改您的设置:
/usr/local/psa/admin/htdocs/domains/databases/phpMyAdmin/libraries/config.default.php
/usr/local/psa/admin/htdocs/domains/databases/phpMyAdmin/libraries/config.default.php
Change $cfg['ExecTimeLimit'] = 300;
to $cfg['ExecTimeLimit'] = 0;
更改$cfg['ExecTimeLimit'] = 300;
为$cfg['ExecTimeLimit'] = 0;
And restart with Plesk UI or use:
并使用 Plesk UI 重新启动或使用:
/etc/init.d/psa restart
and
/etc/init.d/httpd restart
/etc/init.d/psa restart
和
/etc/init.d/httpd restart
回答by user3057553
If using Cpanel/WHM the location of file config.default.php
is under
如果使用 Cpanel/WHM,文件的位置config.default.php
在
/usr/local/cpanel/base/3rdparty/phpMyAdmin/libraries
/usr/local/cpanel/base/3rdparty/phpMyAdmin/libraries
and you should change the $cfg['ExecTimeLimit'] = 300;
to $cfg['ExecTimeLimit'] = 0;
你应改变$cfg['ExecTimeLimit'] = 300;
以$cfg['ExecTimeLimit'] = 0;
回答by Supratim Roy
I was having the issue previously in XAMPP
localhost with phpmyadmin version 4.2.11.
我之前在XAMPP
localhost 中使用 phpmyadmin 版本 4.2.11时遇到过这个问题。
Increasing the timeout in php.ini
didn't helped either.
增加超时php.ini
也没有帮助。
Then I edited xampp\phpMyAdmin\libraries\config.default.php
to change the value of $cfg['ExecTimeLimit']
, which was 300 by default.
然后我编辑xampp\phpMyAdmin\libraries\config.default.php
更改 的值$cfg['ExecTimeLimit']
,默认情况下为 300。
That solved my issue.
那解决了我的问题。
回答by Artur K?pp
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.
如果你们中的任何人碰巧使用 WAMP,那么至少在当前版本 (3.0.6 x64) 中有一个文件,<your-wamp-dir>\alias\phpmyadmin.conf
其中覆盖了您的某些 php.ini 选项。
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
# 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
回答by Deepak Keynes
None of the above answers solved it for me.
以上答案都没有为我解决。
I cant even find the 'libraries' folder in my xampp - ubuntu also.
我什至无法在我的 xampp - ubuntu 中找到“库”文件夹。
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.
- 刚刚重新启动了apache和mysql。再次登录phpmyadmin,它照常工作。
Thanks me..!!
谢谢我..!!
回答by Victor Anuebunwa
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.
我也遇到了这个问题,并尝试了我在网上找到的不同内存扩展技术,但遇到了更多麻烦。我决定使用 MySQL 控制台source
命令,当然您不必担心 phpMyAdmin 或 PHP 最大执行时间和限制。
Syntax: source c:\path\to\dump_file.sql
句法: 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.
注意:最好指定转储文件的绝对路径,因为可能不知道 mysql 工作目录。
回答by josef
To increase the phpMyAdmin Session Timeout, open config.inc.php in the root phpMyAdmin directory and add this setting (anywhere).
要增加 phpMyAdmin 会话超时,请打开 phpMyAdmin 根目录中的 config.inc.php 并添加此设置(任何地方)。
$cfg['LoginCookieValidity'] = <your_new_timeout>;
Where is some number larger than 1800.
哪里有一些大于 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.
请始终牢记,对于开发服务器而言,较短的 cookie 生命周期是非常好的。所以不要在你的生产服务器上这样做。