在同一域上为 Wordpress 站点运行 php 脚本时出现错误:
Could not connect: User 'abc' has exceeded the 'max_connections_per_hour' resource (current value: 10)
MySql 数据库的限制应该是什么?现在我应该连接到数据库吗?
你超过了mysql的限制,看看mysql doc,你可以看到:
mysql> GRANT ALL ON customer.* TO 'francis'@'localhost'
-> IDENTIFIED BY 'frank'
-> WITH MAX_QUERIES_PER_HOUR 20
-> MAX_UPDATES_PER_HOUR 10
-> MAX_CONNECTIONS_PER_HOUR 5;
您只需要增加 MAX_CONNECTIONS_PER_HOUR 或删除限制,只需使用这个:
mysql> GRANT USAGE ON *.* TO 'francis'@'localhost'
-> WITH MAX_CONNECTIONS_PER_HOUR 0;
要在 WordPress 上允许持久连接,请看这篇文章(我自己没有测试过):http ://www.mydigitallife.info/using-php-mysql-persistent-connections-to-run-wordpress-blog/