Connection Error - SQLSTATE[HY000] [2002] Operation timed out

安稳与你 提交于 2019-12-23 17:17:04

问题


I am having trouble connecting from my application server which is a Windows 2008 R2 box to MySQL Server box also running on Windows 2008 R2.

The Laravel application reports the error:

exception 'PDOException' with message 'SQLSTATE[HY000] [2002] Operation timed out'

The odd thing is I can connect via MySQL Workbench from the application server to the MySQL Server using exactly the same credentials and port, and the connection is quick.

Can anyone shed any light on how this can be?


回答1:


Check .env file or config\database.php file, set correct username, password, database name, ip and port.




回答2:


It was a firewall setting applied by our host provider. Thanks anyway.



来源:https://stackoverflow.com/questions/38905581/connection-error-sqlstatehy000-2002-operation-timed-out

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!