Google Cloud deployment to connect to external mySQL db problem

System Information
  • 3.4.3:
  • Win 10:
  • mySQL:
  • 12.x.x:
  • 6:
  • 1.22:

Hi, I am finding some problem deploying on Google Cloud (App Engine) using a remote mySQL. Following the documentation I created the app.yaml but I get an error at Strapi startup with mySQL access denied.

//  ./app.yaml
runtime: nodejs12
instance_class: F2
env_variables:
  HOST: '0.0.0.0'
  NODE_ENV: 'production'
  DATABASE_HOST: 'mysql.remote.com'
  DATABASE_PORT: 3306
  DATABASE_USERNAME: 'username'
  DATABASE_PASSWORD: 'password'
//  ./config/database.js
module.exports = ({ env }) => ({
  defaultConnection: 'default',
  connections: {
    default: {
      connector: 'bookshelf',
      settings: {
        client: 'mysql',
        host: env('DATABASE_HOST'),
        port: env.int('DATABASE_PORT'),
        database: env('DATABASE_NAME'),
        username: env('DATABASE_USERNAME'),
        password: env('DATABASE_PASSWORD'),
      },
      options: {}
    },
  },
});
Error from the GCloud console log :
Error: ER_ACCESS_DENIED_ERROR: Access denied for user 'username'@'35.203.247.4' (using password: YES)

I noticed the connection IP is not the server IP relative to the DATABASE_HOST variable set in app.yaml.

I tried also to connect to the same database in local development but I get the same error (IP connection is not the remote mysql but my localhost)
Connection works normally with a mySQL client (workbench) with same credentials.
Thank you