Skip to content

andyrbell/mysql8-authentication

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

MySQL 8.0.4+ authentication with Flyway / MariaDB Driver

Flyway is using the MariaDB JDBC driver, which not appear to support the new default authentication plugin in MySQL 8.0.4, caching_sha2_password.

One way around this is to revert to the previous default authentication plugin:

docker-mysql:
  image: mysql:8.0.11
  command: --default-authentication-plugin=mysql_native_password

The other option would be to download the official MySQL JDBC driver jar and place in the ./drivers directory.

Then mount that directory in the Flyway container:

flyway:
  image: boxfuse/flyway
  command: ...
  volumes:
   - "./sql:/flyway/sql"
   - "./drivers:/flyway/drivers"

This example uses the docker-compose 2.1 syntax to make use of the depends_on: condition option which has been removed in version 3. The docker-compose documentation gives other options for controlling startup order in version 3.