Today, I got following MySQL error in a PHP application: Host ‘host_name’ is blocked because of many connection errors; unblock with ‘mysqladmin flush-hosts’. It means that mysqld has received many connection requests from the given host. Default max_connect_errors value is 10, that is remote host will be blocked if there is more than 10 connection errors.
To fix, type the following command
# mysqladmin flush-hosts
To avoid this happening again, edit my.cnf
# vi /etc/my.cnf
Add the following line
The value of the max_connect_errors system variable determines how many successive interrupted connection requests are permitted. Restart MySQL to reload configuration file
# service mysqld restart
Or, the value ‘max_connect_errors’ can also be set at runtime, type the following commands
# mysql -uroot -p # mysql> SET GLOBAL max_connect_errors=10000;
- How To Restore Default Permissions Of All Files Under / (ROOT)
- How To Install Subversion (SVN) Extension Working With PHP 5.3
- How To Setup Iptables Firewall For A Web Server On CentOS
- How To Start / Shutdown / Reboot Guest Operating Systems With virsh Command On KVM
- Repel port flood by CSF and IPT_Recent
- What is the role of this variables in php.ini file (expose_php – allow_url_fopen – register_globals) ?
- How Do I Block An IP Address On Linux Server ?
- How To Flush The Entire Contents Of Memcache Server
- How To Setup A LAMP Server On Centos 6.0
- Linux Shutdown Command