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

Font: https://laracasts.com/discuss/channels/laravel/sqlstatehy000-2002-connection-timed-out

2 thoughts on “SQLSTATE[HY000] [2002] Operation timed out MySQL”

  1. You actually make it appear really easy together with your presentation but I to find this topic to be really one thing which I believe I would never understand. It kind of feels too complex and very wide for me. I’m looking forward in your next post, I will attempt to get the hang of it!

  2. I love the efforts you have put in this, appreciate it for all the great content.

Leave a Reply