phpMyadmin 中的最大执行时间

发布于 2024-08-01 19:05:31 字数 312 浏览 4 评论 0原文

当我尝试在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(14

挖个坑埋了你 2024-08-08 19:05:31

我也有同样的错误,请转到

xampp\phpMyAdmin\libraries\config.default.php

查找: $cfg['ExecTimeLimit'] = 600;

您可以将“600”更改为任何更高的值,例如“6000”。

最大执行时间(以秒为单位)(0 表示无限制)。

这将修复您的错误。

I have the same error, please go to

xampp\phpMyAdmin\libraries\config.default.php

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.

素食主义者 2024-08-08 19:05:31

对于 Windows 上的 Xampp 版本

将此行添加xampp\phpmyadmin\config.inc.php

$cfg['ExecTimeLimit'] = 6000;

并更改 xampp\php\php.ini

post_max_size = 750M 
upload_max_filesize = 750M   
max_execution_time = 5000
max_input_time = 5000
memory_limit = 1000M

并更改 xampp\mysql\bin\my.ini

max_allowed_packet = 200M

如果有帮助,请不要忘记投票这个答案:)

For Xampp version on Windows

Add this line to xampp\phpmyadmin\config.inc.php

$cfg['ExecTimeLimit'] = 6000;

And Change xampp\php\php.ini to

post_max_size = 750M 
upload_max_filesize = 750M   
max_execution_time = 5000
max_input_time = 5000
memory_limit = 1000M

And change xampp\mysql\bin\my.ini

max_allowed_packet = 200M

Please do not forget to upvote this answer if it was helpful :)

沒落の蓅哖 2024-08-08 19:05:31

我在执行卷曲时遇到了同样的问题。
当我在 php.ini 文件中更改以下内容时,我得到了正确的结果:

max_execution_time = 1000 ;

并且

max_input_time = 1000 ;

也许您的问题应该通过进行上述两项更改并重新启动 apache 服务器来解决。

即使更改上述内容后问题仍然存在,如果您认为这是因为使用 mysql 进行某些数据库操作,您也可以尝试更改此设置:

mysql.connect_timeout = 1000 ; // this is not neccessary

所有这些都应该在 php.ini 文件中更改,并且 apache 服务器应该是
重新启动以查看更改。

I faced the same problem while executing a curl.
I got it right when I changed the following in the php.ini file:

max_execution_time = 1000 ;

and also

max_input_time = 1000 ;

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:

mysql.connect_timeout = 1000 ; // this is not neccessary

All this should be changed in php.ini file and apache server should be
restarted to see the changes.

笑梦风尘 2024-08-08 19:05:31

可能您正在使用 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.

清欢 2024-08-08 19:05:31

你的改变应该有效。 但是,带有“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

扶醉桌前 2024-08-08 19:05:31

ini_set('max_execution_time', 0); 或创建名为 php.ini 的文件并输入第一行 max_execution_time=0 然后保存并将文件放在应用程序的根文件夹中。

就是这样。 祝你好运。

ini_set('max_execution_time', 0); or create file name called php.ini and enter the first line max_execution_time=0 then save it and put the file in your root folder of your application.

That's it. Good luck.

Bonjour°[大白 2024-08-08 19:05:31

更改 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.

小忆控 2024-08-08 19:05:31

在 WAMP 上对我有用的是修改文件:
\Wamp64\alias\phpmyadmin.conf,行:

 php_admin_value max_execution_time 600
 php_admin_value max_input_time 600

我不必更改库文件。

What worked for me on WAMP was modifying file:
\Wamp64\alias\phpmyadmin.conf, lines:

 php_admin_value max_execution_time 600
 php_admin_value max_input_time 600

I did not have to change the library file.

神仙妹妹 2024-08-08 19:05:31

对于 Wamp 用户,

请转到:wamp\apps\phpmyadmin3.3.9\libraries

在第 536 行下,找到 $cfg['ExecTimeLimit'] = 0;

并更改值从 0 到 6000。例如,

$cfg['ExecTimeLimit'] = 0;

重新

$cfg['ExecTimeLimit'] = 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

$cfg['ExecTimeLimit'] = 0;

To

$cfg['ExecTimeLimit'] = 6000;

Restart wamp server and phew.

It works like magic !

筑梦 2024-08-08 19:05:31

在 php.ini 中,您也必须检查 mysql.connect_timeout 。
它负责关闭套接字并返回致命错误。
例如,将其更改为:

mysql.connect_timeout = 3600

该时间将始终以秒为单位计算,因此在我的示例中您有 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:

mysql.connect_timeout = 3600

That time will be always counted in seconds, so in my example you have 1 hour.

旧人哭 2024-08-08 19:05:31

“零”无限时间。

C:\Apache24\htdocs\phpmyadmin\libraries\Config.class.php

/**
 * maximum execution time in seconds (0 for no limit)
 *
 * @global integer $cfg['ExecTimeLimit']
 */
$cfg['ExecTimeLimit'] = 0;

您还可以直接从 MySQL 导入大文件作为查询或 PHP 查询。

使用这种方法,我只花了 18 秒就将 500,000 行导入到本地服务器上。

(首先创建表)-然后:

LOAD DATA LOCAL INFILE 'Path_To_Your_File.csv' 
INTO TABLE Your_Table_Name 
FIELDS TERMINATED BY ',' 
LINES TERMINATED BY '\n' 

'ZERO' for unlimited time.

C:\Apache24\htdocs\phpmyadmin\libraries\Config.class.php

/**
 * maximum execution time in seconds (0 for no limit)
 *
 * @global integer $cfg['ExecTimeLimit']
 */
$cfg['ExecTimeLimit'] = 0;

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:

LOAD DATA LOCAL INFILE 'Path_To_Your_File.csv' 
INTO TABLE Your_Table_Name 
FIELDS TERMINATED BY ',' 
LINES TERMINATED BY '\n' 
黄昏下泛黄的笔记 2024-08-08 19:05:31

在 Linux 上,您需要创建 $cfg['ExecTimeLimit']

首先,找到 PHP 配置文件。

常用位置:/etc/phpmyadmin/config.inc.php

使用您喜欢的文本编辑器编辑 PHP 配置文件。 您需要 root 或超级用户权限才能执行此操作,因此请使用 sudo

sudo nano /etc/phpmyadmin/config.inc.php

添加行:

$cfg['ExecTimeLimit'] = 600;

保存更改并退出文本编辑器(在 nano 中,您可以通过按 CTRL + O 保存,然后按 Enter,然后按 CTRL + X 退出)。

最后,重新启动您的网络服务器以使设置生效。

sudo service apache2 restart

如果对您有帮助,别忘了点赞

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.

sudo nano /etc/phpmyadmin/config.inc.php

Add the line:

$cfg['ExecTimeLimit'] = 600;

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.

sudo service apache2 restart

Don't forget to upvote if this helped you

穿越时光隧道 2024-08-08 19:05:31

转到 xampp/php/php.ini

找到这一行:

max_execution_time=30

并将其值更改为您想要的任何数字。 重新启动阿帕奇。

Go to xampp/php/php.ini

Find this line:

max_execution_time=30

And change its value to any number you want. Restart Apache.

单身情人 2024-08-08 19:05:31

导入大sql文件使用mysql workbench,它会快速导入,并且不会抛出任何时间错误。

to import big sql file use mysql workbench , it will import quickly , and will not throw any time error .

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文