0

planetscale details are Like below

DATABASE_URL='mysql://username:************@host/strapi_db_name?ssl={"rejectUnauthorized":true}'

same value using to connect

module.exports = ({ env }) => ({
  connection: {
    client: 'mysql2',
    connection: {
      host: env('DATABASE_HOST', 'server hostname'),
      database: env('DATABASE_NAME', 'strapi_db_name'),
      user: env('DATABASE_USERNAME', 'username'),
      password: env('DATABASE_PASSWORD', 'password'),
      ssl: {
        rejectUnauthorized: env('DATABASE_SSL', true)
      },
    },
  }
});

I got Error like:

 debug: ⛔️ Server wasn't able to start properly.
[2023-02-23 11:34:08.104] error: Unknown dialect mysql2
Error: Unknown dialect mysql2
  • Just use the normal `mysql` but even that as mentioned on strapi forum and some threads, Strapi said that they won't drop the "foreign key constraints" so kind of hard to bypass it https://forum.strapi.io/t/has-anyone-used-planetscale-com/9875 but I've seen that somebody on reddit bypass it but without ease – devzom Feb 27 '23 at 21:59

1 Answers1

1

mysql2 is not a valid option among Strapi's supported database clients, please see this section in the documentation: https://docs.strapi.io/dev-docs/configurations/database#connection-configuration-object

khangnd
  • 323
  • 3
  • 11