我正在尽最大努力学习 Google 的云平台。他们有 CloudSQL 产品,我正在通过 this NodeJS tutorial 学习.在我部署到他们的 appspot server 之前一切都很好,此时我收到以下错误:
connect ECONNREFUSED 127.0.0.1:3306
我查看了整个 NodeJS 项目,但没有看到其中的任何内容,也没有看到引用 localhost 或 127.0.0.1 的 Cloud Console。谷歌搜索错误到目前为止没有帮助。有任何想法吗?
最佳答案
在服务器上运行时我无法修复这个问题,但是使用这个文件我能够从本地和生产环境读取/写入,现在我在我自己的应用程序中使用这个连接字符串
https://cloud.google.com/appengine/docs/flexible/nodejs/using-cloud-sql https://github.com/GoogleCloudPlatform/nodejs-docs-samples/tree/master/appengine/cloudsql
关于node.js - 使用 Google CloudSQL,获取 "connect ECONNREFUSED 127.0.0.1:3306",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41603019/