0

In docker or docker-compose, how to set the mysql8.0 password type to be mysql_native_password. I run the below query after I run the docker container, but I want it auto change when I create the container.

ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'root'; ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'root'; ALTER USER 'default'@'%' IDENTIFIED WITH mysql_native_password BY 'secret'; 
4
  • Are you using this image? Commented Jul 22, 2022 at 3:34
  • This seems to be an old answer, so I don't know if it still works, but have you tried this?: stackoverflow.com/a/49021165/3181933 Commented Jul 22, 2022 at 3:36
  • grajnish/mysql8.0.22 I using this one. @DiplomacyNotWar Commented Jul 22, 2022 at 3:40
  • Does that image provide anything that the official docker image doesn't? You'll probably have a better time finding answers using the official image. Also, when you say "I run the below query after I run the docker container" - can I take that to mean that you're running this automatically as another Docker step? Or is this something you're doing entirely manually? Commented Jul 22, 2022 at 3:46

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.