【发布时间】:2015-03-01 16:28:51
【问题描述】:
我有一个正在运行的 Google App Engine 应用程序,数据库已设置并且应该可以工作(与开发服务器一起使用),但在部署应用程序时无法连接到数据库。我收到以下错误:
Warning: PDO::__construct(): MySQL server has gone away in /base/data/home/apps/s~helloworldtmb/1.382580389844400668/guestbook.php on line 26
Warning: PDO::__construct(): Error while reading greeting packet. PID=-1 in /base/data/home/apps/s~helloworldtmb/1.382580389844400668/guestbook.php on line 26 {"outcome":false,"message":"Unable to connect."}
第 26 行是
$db = new pdo('mysql:unix_socket=/cloudsql/<helloworldtmb>:<helloworldtmb:helloo>;dbname=guestbook', 'root', 'p');
helloworldtmb 是应用程序 ID,helloworldtmb:helloo 是实例名称。有什么想法吗?
【问题讨论】:
标签: php mysql google-app-engine pdo cloud