I have this yml file for configuration of MySQL in docker:
# Use root/example as user/password credentials
version: '3.1'
services:
db:
image: mysql
restart: always
environment:
MYSQL_ROOT_PASSWORD: 'pass'
MYSQL_DATABASE: 'db'
MYSQL_USER: 'user'
MYSQL_PASSWORD: 'pass'
adminer:
image: adminer
restart: always
ports:
- 8888:8080
And I start the container using following command from the same directory where yml is located:
docker-compose -f stack.yml up
Then I got this error:
UPDATE `mysql`. `user` SET `plugin` = 'mysql_native_password' WHERE (`Host` = 'YOUR MATOMO DB HOST NAME') and (`User` = 'YOUR MATOMO DB USER NAME'); or alternatively: 2) Create a new database and database user in MySQL by running the SQL queries from this FAQ, and then update your matomo/config/config.
The mysql_native_password authentication plugin is the default authentication plugin that will be used for an account created when no authentication plugin is explicitly mentioned and old_passwords=0 is set.
The auth_socket plugin checks whether the socket user name matches the MySQL user name specified by the client program to the server. If the names do not match, the plugin also checks whether the socket user name matches the name specified in the authentication_string column of the mysql. user table row.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With