'Strapi+mysql deploy on Google Cloud not working

I'm trying to deploy my app to App Engine but when I open the url of the strapi app I get Server error and looking in the logs I got this error log

What I can do to fix it?

this is my database.js file

    module.exports = ({ env }) => ({
  defaultConnection: 'default',
  connections: {
    default: {
      connector: 'bookshelf',
      settings: {
        client: 'mysql',
        socketPath: `/cloudsql/${env('INSTANCE_CONNECTION_NAME')}`,
        database: env('DATABASE_NAME'),
        username: env('DATABASE_USERNAME'),
        password: env('DATABASE_PASSWORD'),
        ssl: false,
      },
    },
  },
});


Solution 1:[1]

I’m guessing you are following the Strapi + GAE official guide because your database.json file looks like the one in the example. Though this one is using postgres, I recommend reading the guide on databases and trying to start a new project following the instructions for MySql, or read this blog entry if you haven’t.

Also, I found you have already opened a question in the Strapi Forum which is great, just be sure to keep updated with any relevant information.

Finally, here is this old question that is working with your same set up. Even though it is not very recent you can take a look and try some of their code, where the database.json file looks like this:

{
  "defaultConnection": "default",
  "connections": {
    "default": {
      "connector": "strapi-hook-bookshelf",
      "settings": {
        "client": "mysql",
        "host": "${process.env.MYSQL_HOST || '127.0.0.1'}",
        "port": "${process.env.MYSQL_PORT || '3306'}",
        "database": "${process.env.MYSQL_DATABASE}",
        "username": "${process.env.MYSQL_USERNAME}",
        "password": "${process.env.MYSQL_PASSWORD}",
        "socketPath": "/cloudsql/${process.env.INSTANCE_CONNECTION_NAME}"
      },
      "options": {
      }
    }
  }
}

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Alex