简体   繁体   中英

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

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?

检查 .env 文件或 config\\database.php 文件,设置正确的用户名、密码、数据库名称、ip 和端口。

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM