1

Running a local config, the connection works fine. I've installed and have a cloud_sql_proxy running and ready for new connections.

Here's my sequelize connection code:

const sequelize = new Sequelize(DB_NAME, DB_USER, DB_PASS, {
  dialect: 'mysql',
  host: `/cloudsql/${CLOUD_SQL_CONNECTION_NAME}`,
  pool: {
        max: 30,
        min: 0,
        idle: 10000,
        acquire: 1000000,
      },
  dialectOptions: {
    connectTimeout: 100000
  }
});

At some point I set my max connection, acquire, and connectTimeout variables to absurdly high numbers, but still no luck, but I started getting a specific IP address located in London on port 3306.

jct
  • 69
  • 3
  • 11

1 Answers1

0

I was able to connect to the cloud db by modifying my config to the following:

const sequelize = new Sequelize(DB_NAME, DB_USER, DB_PASS, {
  dialect: 'mysql',
  host: DB_HOST,
  timestamps: false,
  pool: {
        max: 5,
        min: 0,
        idle: 10000
      },
}); 

The difference is I pointed the host to the actual db IP address instead of the /cloudsql/${CLOUD_SQL_CONNECTION_NAME} path.

jct
  • 69
  • 3
  • 11