I have this yml file for configuration of MySQL in docker:
# Use root/example as user/password credentials
version: \'3.1\'
services:
db:
image: mysq
If you encounter this error but still wish to use MySQL v.8. You can do this by telling MySQL Server to use the legacy authentication plugin.
So, your compose file will look like this:
# Use root/example as user/password credentials
version: '3.1'
services:
db:
image: mysql
command: --default-authentication-plugin=mysql_native_password
restart: always
environment:
MYSQL_ROOT_PASSWORD: 'pass'
MYSQL_DATABASE: 'db'
MYSQL_USER: 'user'
MYSQL_PASSWORD: 'pass'
adminer:
image: adminer
restart: always
ports:
- 8888:8080