phpMyadmin 中的最大执行时间
当我尝试在 phpMyadmin 中执行(某些)查询时,出现此错误
致命错误:超过了 60 秒的最大执行时间 C:\xampp\phpmyadmin\libraries\dbi\mysql.dbi.lib.php 第 140 行
因为我有一个非常大的表(超过 900 万条记录),
我编辑了文件 C:\xampp\php\php.ini
和将“最大执行时间”的值从 60 更改为 1000,然后重新启动 PHP,仍然出现相同的错误。
有什么解决办法吗?
When I try to execute (some) queries in phpMyadmin I get this error
Fatal error: Maximum execution time of 60 seconds exceeded in
C:\xampp\phpmyadmin\libraries\dbi\mysql.dbi.lib.php on line 140
because I have a very large table (over 9 millions records)
I have edited the file C:\xampp\php\php.ini
and changed the value of "max execution time" from 60 to 1000 then restarts the PHP and still have the same error.
Any solution?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(14)
我也有同样的错误,请转到
查找:
$cfg['ExecTimeLimit'] = 600;
您可以将“600”更改为任何更高的值,例如“6000”。
最大执行时间(以秒为单位)(0 表示无限制)。
这将修复您的错误。
I have the same error, please go to
Look for :
$cfg['ExecTimeLimit'] = 600;
You can change '600' to any higher value, like '6000'.
Maximum execution time in seconds is (0 for no limit).
This will fix your error.
对于 Windows 上的 Xampp 版本
将此行添加到 xampp\phpmyadmin\config.inc.php
并更改 xampp\php\php.ini 为
并更改 xampp\mysql\bin\my.ini
如果有帮助,请不要忘记投票这个答案:)
For Xampp version on Windows
Add this line to xampp\phpmyadmin\config.inc.php
And Change xampp\php\php.ini to
And change xampp\mysql\bin\my.ini
Please do not forget to upvote this answer if it was helpful :)
我在执行卷曲时遇到了同样的问题。
当我在 php.ini 文件中更改以下内容时,我得到了正确的结果:
并且
也许您的问题应该通过进行上述两项更改并重新启动 apache 服务器来解决。
即使更改上述内容后问题仍然存在,如果您认为这是因为使用 mysql 进行某些数据库操作,您也可以尝试更改此设置:
I faced the same problem while executing a curl.
I got it right when I changed the following in the
php.ini
file:and also
Probably your problem should be solved by making above two changes and restarting the apache server.
Even after changing the above the problem persists and if you think it's because of some database operation using mysql you can try changing this also:
可能您正在使用 XMAPP 作为服务,要正确重新启动 XMAPP,您必须打开 XMAPP 控制面板,取消选中 Apache 和 MySQL 的“Svc”mdodules。 然后点击退出,现在重新启动XMAPP就完成了。
Probabily you are using XMAPP as service, to restart XMAPP properly, you have to open XMAPP control panel un-check both "Svc" mdodules against Apache and MySQL. Then click on exit, now restart XMAPP and you are done.
你的改变应该有效。 但是,带有“xampp”堆栈的 php.ini 配置文件可能很少。 尝试确定是否存在“apache”特定的 php.ini。 一个可能的位置是:
C:\xampp\apache\bin\php.ini
Your change should work. However, there are potentially few php.ini configuration files with the 'xampp' stack. Try to identify whether or not there's an 'apache' specific php.ini. One potential location is:
C:\xampp\apache\bin\php.ini
ini_set('max_execution_time', 0);
或创建名为php.ini
的文件并输入第一行max_execution_time=0
然后保存并将文件放在应用程序的根文件夹中。就是这样。 祝你好运。
ini_set('max_execution_time', 0);
or create file name calledphp.ini
and enter the first linemax_execution_time=0
then save it and put the file in your root folder of your application.That's it. Good luck.
更改 Web 应用程序的
php.ini
需要重新启动 Apache。您应该通过运行执行函数
phpinfo()
的 PHP 脚本来验证更改是否已发生。 该函数的输出将告诉您许多 PHP 参数,包括超时值。您可能还更改了
php.ini
的副本,该副本与 Apache 使用的文件不同。Changing
php.ini
for a web application requires restarting Apache.You should verify that the change took place by running a PHP script that executes the function
phpinfo()
. The output of that function will tell you a lot of PHP parameters, including the timeout value.You might also have changed a copy of
php.ini
that is not the same file used by Apache.在 WAMP 上对我有用的是修改文件:
\Wamp64\alias\phpmyadmin.conf,行:
我不必更改库文件。
What worked for me on WAMP was modifying file:
\Wamp64\alias\phpmyadmin.conf, lines:
I did not have to change the library file.
对于 Wamp 用户,
请转到:
wamp\apps\phpmyadmin3.3.9\libraries
在第 536 行下,
找到 $cfg['ExecTimeLimit'] = 0;
并更改值从 0 到 6000。例如,
重新
启动 wamp 服务器并唷。
它的作用就像魔术一样!
Well for Wamp User,
Go to:
wamp\apps\phpmyadmin3.3.9\libraries
Under line 536,
locate $cfg['ExecTimeLimit'] = 0;
and change the value from 0 to 6000. e.g
To
Restart wamp server and phew.
It works like magic !
在 php.ini 中,您也必须检查 mysql.connect_timeout 。
它负责关闭套接字并返回致命错误。
例如,将其更改为:
该时间将始终以秒为单位计算,因此在我的示例中您有 1 小时。
In php.ini you must check mysql.connect_timeout either.
That's responsible for socket closing and returning the Fatal.
So, for example, change it to:
That time will be always counted in seconds, so in my example you have 1 hour.
“零”无限时间。
C:\Apache24\htdocs\phpmyadmin\libraries\Config.class.php
您还可以直接从 MySQL 导入大文件作为查询或 PHP 查询。
使用这种方法,我只花了 18 秒就将 500,000 行导入到本地服务器上。
(首先创建表)-然后:
'ZERO' for unlimited time.
C:\Apache24\htdocs\phpmyadmin\libraries\Config.class.php
You could also import the large file right from MySQL as query or a PHP query.
500,000 rows just took me 18 seconds to import on local server, using this method.
(create table first) - then:
在 Linux 上,您需要创建
$cfg['ExecTimeLimit']
。首先,找到 PHP 配置文件。
常用位置:
/etc/phpmyadmin/config.inc.php
。使用您喜欢的文本编辑器编辑 PHP 配置文件。 您需要 root 或超级用户权限才能执行此操作,因此请使用
sudo
。添加行:
保存更改并退出文本编辑器(在 nano 中,您可以通过按 CTRL + O 保存,然后按 Enter,然后按 CTRL + X 退出)。
最后,重新启动您的网络服务器以使设置生效。
如果对您有帮助,别忘了点赞
On Linux you need to create the
$cfg['ExecTimeLimit']
.First, locate the PHP configuration file.
Commom locations:
/etc/phpmyadmin/config.inc.php
.Edit the PHP configuration file using your preferred text editor. You'll need root or superuser privileges to do this, so use
sudo
.Add the line:
Save the changes and exit the text editor (in nano you can save by press CTRL + O, then press Enter, and exit by press CTRL + X).
After all, restart your web server to the settings take effect.
Don't forget to upvote if this helped you
转到
xampp/php/php.ini
找到这一行:
并将其值更改为您想要的任何数字。 重新启动阿帕奇。
Go to
xampp/php/php.ini
Find this line:
And change its value to any number you want. Restart Apache.
导入大sql文件使用mysql workbench,它会快速导入,并且不会抛出任何时间错误。
to import big sql file use mysql workbench , it will import quickly , and will not throw any time error .