The Blog

SQLSTATE[HY000] [2002] Operation timed out MySQL

When you have this problem from MySQL with a fresh installation, you have to comment the bind address line in ‘/etc/mysql/mysql.conf.d/mysqld.cnf’:


Don’t forget to restart MySQL service

sudo service mysql restart

If you are using the UFW service, add this rule to your firewall:

sudo ufw allow from <IP_FROM_YOU_CONNECT> to any port 3306


Leave a comment