我正在使用以下系统:
$ cat /etc/redhat-release Red Hat Enterprise Linux Server release 7.1 (Maipo) $ uname -a Linux ip-XXXX.ec2.internal 3.10.0-229.14.1.el7.x86_64 #1 SMP Tue Aug 25 11:21:22 EDT 2015 x86_64 x86_64 x86_64 GNU/Linux $ rpm -q php php-5.4.32-1.el7.remi.x86_64 $
并且偶尔会出现以下错误:
Warning: mysql_connect(): Host 'ip-XXXX.ec2.internal' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts' in /var/www/html/X/wp-includes/wp-db.php on line 1454 Error establishing a database connection This either means that the username and password information in your wp-config.php file is incorrect or we can't contact the database server at ip-XXXX.ec2.internal. This could mean your host's database server is down. Are you sure you have the correct username and password? Are you sure that you have typed the correct hostname? Are you sure that the database server is running? If you're unsure what these terms mean you should probably contact your host. If you still need help you can always visit the WordPress Support Forums.
在我运行mysqladmin flush-hosts错误消失了。
我的问题是:究竟是什么造成的呢? 我可以调整什么来防止这个错误发生太频繁?