【发布时间】:2018-09-04 06:16:54
【问题描述】:
我使用 node js(弹性环境)在应用引擎上部署了我的代码。
config.json
{
"GCLOUD_PROJECT": "XXXXXX",
"DATA_BACKEND": "cloudsql",
"MYSQL_USER": "XXXX",
"MYSQL_PASSWORD": "XXXXX",
"INSTANCE_CONNECTION_NAME": "XXXXXX:us-central1:XXXXX"
}
model-cloudsql.js
const options = {
user: config.get('MYSQL_USER'),
password: config.get('MYSQL_PASSWORD'),
database: 'XXXXX'
};
if (config.get('INSTANCE_CONNECTION_NAME') && config.get('NODE_ENV') === 'production') {
options.socketPath = `/cloudsql/${config.get('INSTANCE_CONNECTION_NAME')}`;
}
const connection = mysql.createConnection(options);
我收到以下错误:
“致命错误后无法将查询入队。”
请提供任何反馈。
【问题讨论】:
-
根据snakecharmerb的链接问题,这通常与不正确的连接管理有关。你能解决这个问题吗?您每次运行时都会收到此错误吗?
-
是的,如果您有任何解决方案,请提供给我
标签: node.js google-app-engine google-cloud-platform google-cloud-sql