Mysql 连接超时问题

Mysql connection timeout issue

我在前端为 virtumart (Joomla) 开发了类别虎钳搜索功能。 它在我们的本地服务器上运行良好,但是当我在服务器上上传时它给我 mysql 连接超时错误。显示如下,

Attention no standard shopper group set MySQL server has gone away SQL=SELECT * FROM `sxrth_virtuemart_shoppergroups` WHERE `default` = "2" AND (`virtuemart_vendor_id` = "1" OR `shared` = "1") AND `published`="1"
Attention no standard shopper group set MySQL server has gone away SQL=SELECT * FROM `sxrth_virtuemart_shoppergroups` WHERE `default` = "2" AND (`virtuemart_vendor_id` = "1" OR `shared` = "1") AND `published`="1"

No Shop Currency defined! Go to http://www.domain.com/administrator/index.php?option=com_virtuemart&view=user&task=editshop (I already apply currency and List of accepted currencies for virtuemart for this link)

我尝试了几个选项,例如

set_time_limit(o);
ini_set('mysql.connect_timeout', 14400);
ini_set('default_socket_timeout', 14400);

但这对我不起作用。

我还在 publc_html 文件夹中创建了 php.ini 文件。看起来像下面

register_globals = off
allow_url_fopen = off
mysql.connect_timeout = 600
mysql.default_socket = 600
expose_php = Off
max_input_time = 600

max_execution_time 600
memory_limit = 360M

我还是不行

我应该采取哪些行动才能获得解决方案?

在完成 mysqli_reconnect 并对特定字段进行索引后,它终于对我起作用了。