adonisjs / v5-docs

📚 Source code and documentation for the official docs website.
https://v5-docs.adonisjs.com
88 stars 138 forks source link

Driver config: mysql2 #166

Closed careless10 closed 2 years ago

careless10 commented 2 years ago

On the documentation it says to install the following

npm i mysql2

but it says to use it

mysql: {
  client: 'mysql',
  connection: {
    host: Env.get('MYSQL_HOST'),
    port: Env.get('MYSQL_PORT'),
    user: Env.get('MYSQL_USER'),
    password: Env.get('MYSQL_PASSWORD', ''),
    database: Env.get('MYSQL_DB_NAME'),
  },
  migrations: {
    naturalSort: true,
  },
  healthCheck: false,
  debug: false,
}

i am not quite sure if this is a bug or its supposed to work that way, i changed the client: 'mysql' to 'mysql2' and it worked, could you confirm? this should solve mysql 8.* issues

thetutlage commented 2 years ago

Setting both mysql and mysql2 should work. Just make sure to remove the mysql dependency from your project and then mysql2 will be used automatically even when the client is set to mysql

RomainLanz commented 2 years ago

Closing since no answer from issue reporter.