Open ngmathiou opened 6 months ago
Duplicate of #1048
As it seems duplicate of the #1048, I assume that using the bellow docker-compose should enable the container to start with mysql_native_password.
---
version: '3.3'
volumes:
data:
driver: local
services:
mysql:
image: mysql:latest
container_name: mysql
restart: unless-stopped
command:
- --mysql-native-password=ON
- --log-error-verbosity=3
environment:
MYSQL_DATABASE: 'db'
MYSQL_USER: 'username'
MYSQL_PASSWORD: '*********'
MYSQL_ROOT_PASSWORD: '*********'
ports:
- '3306:3306'
expose:
- '3306'
volumes:
- data:/var/lib/mysql
Using the section:
command:
- --mysql-native-password=ON
In my case I'm unable to start and access the database I have no previous backups in order to use 8.3 version for example.
The approach of enable mysql-native-password should have worked or am I missing something like completely deprecating the option to enable mysql_native_password and I should start with fresh install of mysql and lose any data prior to the update.
You could try using mysql:8.4-oraclelinux8
So, it could also be related to #1058 (https://github.com/docker-library/mysql/issues/1058#issuecomment-2105000516).
I think you can gain access with --skip-grant-tables
and then docker exec
into the container and run mysql
commands from there to alter (or backup) the database as needed.
If you do manage to get it working with the officially deprecated mysql_native_password
functionality enabled, you'll want to keep https://github.com/docker-library/mysql/issues/1054#issuecomment-2099278269 in mind:
With the caveat/warning that they do intend to remove that functionality completely in the future (so eventually the square wheel will roll again and this will come back out from under the rug :see_no_evil:).
You could try using
mysql:8.4-oraclelinux8
So, it could also be related to #1058 (#1058 (comment)).
I think you can gain access with
--skip-grant-tables
and thendocker exec
into the container and runmysql
commands from there to alter (or backup) the database as needed.
I've tried using mysql:8.4-oraclelinux8
with no luck. Also I've already checked your comment and tried the resolution you suggested on issue #1058 with no luck.
What actually worked for me was the --skip-grant-tables
Thank you very much, from this point I can run any necessary mysql
commands!
When I'm adding: --mysql-native-password=ON on the docker-compose file, I'm unable to start the mysql database
When removing the above mentioned command I'm able to start the database but cannot access it with error ERROR 1524 (HY000): Plugin 'mysql_native_password' is not loaded
I'm using mysql:latest tag 8.4.0 and prior I altered all user authentications to mysql_native_password, when I added the command in the docker-compose it led to the above error and I'm locked out of the database.
Is there any way I can gain access again to the database files and start the database with mysql_native_password support ON ?