Sometimes Mysql server returns "Connection timed out error"

474 views Asked by At

I using tinker on a local Laravel development envrionment and my project is connected to a MySQL instance of RDS which is only for development.

I use tinker alot of times on work. Sometimes when I'm using tinker MySQL returns:

SQLSTATE[HY000] [2002] Connection timed out

If that error occures I can't do anything about database over 1 hours. When I try to use the database on tinker after 1 hour, or over a hour after from the error occured, it works well again.

I don't know what the problem is with my project or mysql.

The error is occurin on only in local environment, not on production or development server.

I try to find about error, and solutions, many stackoverflow answers was doesn't help to me.

  1. Check the connection address: not for me. it worked well, and it will work after some hours.
  2. Firewall problem: not for me. it worked well. and it work after some hours.

I think I can fix it with mysql config but I don't know how or what.

0

There are 0 answers