运行配置为使用具有相应实例名称的第二代MYSQL实例的Google Nodejs应用程序时,重复出现ENOENT错误 . 这可以使用cloudproxy在我的localhost上运行,但在计算群集实例中会产生以下错误 . 应用程序引擎部署发生类似的错误 .

error when connecting to db: { Error: connect ENOENT cybers-cafe:us-east1:cybers-cafe
    at Object.exports._errnoException (util.js:1026:11)
    at exports._exceptionWithHostPort (util.js:1049:20)
    at PipeConnectWrap.afterConnect [as oncomplete] (net.js:1085:14)
    --------------------
    at Protocol._enqueue (/home/jordocote/cybers-cafe-service/node_modules/mysql/lib/protocol/P
    at Protocol.handshake (/home/jordocote/cybers-cafe-service/node_modules/mysql/lib/protocol/
    at Connection.connect (/home/jordocote/cybers-cafe-service/node_modules/mysql/lib/Connectio
    at Timeout.handleDisconnect [as _onTimeout] (/home/jordocote/cybers-cafe-service/entities/r
    at ontimeout (timers.js:365:14)
    at tryOnTimeout (timers.js:237:5)
    at Timer.listOnTimeout (timers.js:207:5)
  code: 'ENOENT',
  errno: 'ENOENT',
  syscall: 'connect',
  address: 'cybers-cafe:us-east1:cybers-cafe',
  fatal: true }

我尝试过使用各种socketPath值:

  • cybers-cafe:us-east1:cybers-cafe,

  • / cloudsql / cybers-cafe:us-east1:cybers-cafe,

  • MYSQL实例的IP地址(带和无端口),

  • 只是3306

它们都在计算群集实例和应用程序引擎部署中产生相同的错误 . 我也无法使用计算群集实例中的mysql客户端直接连接到MYSQL实例 .

我已按照https://cloud.google.com/sql/docs/mysql/connect-app-engine等文档中的设置步骤进行操作,如下所示:

env_variables:
  MYSQL_USER: ******
  MYSQL_PASSWORD: ***********
  MYSQL_DATABASE: cyberscafe
  # This path was printed to the console when you started the proxy, and is of
  # the format: `/[DIR]/[YOUR_PROJECT_ID]:[YOUR_REGION]:[YOUR_INSTANCE_NAME]`
  MYSQL_SOCKET_PATH: cybers-cafe:us-east1:cybers-cafe
beta_settings:
  # The connection name of your instance on its Overview page in the Google
  # Cloud Platform Console, or use `[YOUR_PROJECT_ID]:[YOUR_REGION]:[YOUR_INSTANCE_NAME]`
  cloud_sql_instances: cybers-cafe:us-east1:cybers-cafe