Thursday, 14 February 2019

Docker MySQL starting up with random ROOT password

docker container run --detach --env MYSQL_RANDOM_ROOT_PASSWORD=yes --name johnsmysql --publish 3307:3306 mysql


The random password can be found by going through the container logs with the mysql instance.

docker container logs johnsmysql



docker container logs --follow johnsmysql 2>&1  | egrep -o 'PASSWORD\s*:\s*\w*$' 



No comments:

Post a Comment