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
  HOST: ''
  NODE_ENV: 'production'
//  ./config/database.js
module.exports = ({ env }) => ({
  defaultConnection: 'default',
  connections: {
    default: {
      connector: 'bookshelf',
      settings: {
        client: 'mysql',
        host: env('DATABASE_HOST'),
        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'@'' (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