Connection timeout on cloud sql

心已入冬 提交于 2021-01-27 06:30:21

问题


I've got a Laravel app I'm trying to migrate to Google Cloud. I've already got it setup on App Engine but whenever I try to access it any non-static page which requires a DB connection the app throws up the following error:

2017-08-02 10:21:18,983 INFO _FILE_ONLY_ 2017-08-02 08:21:12 default[20170802t095328] [02-Aug-2017 08:21:12] WARNING: [pool app] child 62 said into stderr: "NOTICE: PHP message: [2017-08-02 08:21:12] production.ERROR: PDOException: SQLSTATE[HY000] [2002] Connection timed out in /app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:43"

2017-08-02 10:21:18,984 INFO _FILE_ONLY_ 2017-08-02 08:21:12 default[20170802t095328] [02-Aug-2017 08:21:12] WARNING: [pool app] child 62 said into stderr: "Stack trace:"

2017-08-02 10:21:18,986 INFO _FILE_ONLY_ 2017-08-02 08:21:12 default[20170802t095328] [02-Aug-2017 08:21:12] WARNING: [pool app] child 62 said into stderr: "#0 /app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php(43): PDO->__construct('mysql:host=35.1...', 'my_db_user', 'my_db_pass', Array)"

Any help in resolving it would be greatly appreciated. Thanks!

来源:https://stackoverflow.com/questions/45456250/connection-timeout-on-cloud-sql

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