Ticker

6/recent/ticker-posts

Ad Code

Install MySQL 5.7 with Docker


 




docker run -d -e MYSQL_ROOT_PASSWORD=12345678 --name mysql5 -p 127.0.0.1:3307:3306 mysql/mysql-server:5.7.33


to list running containers 

# docker ps


the go in to the container with container ID

# docker exec -it f12b6f5ec5aa /bin/bash


bash3.8# mysl -uroot -p


Then just create a user any host or from the docker host only

mysql >  CREATE USER 'root'@'%' IDENTIFIED BY '12345678';  

OR

CREATE USER 'test'@'172.17.0.1' IDENTIFIED WITH mysql_native_password BY '12345678'


mysql >  SELECT user,authentication_string,plugin,host FROM mysql.user;


mysql >  exit


bash3.8# exit


then type the command

# mysql -uroot -p12345678 -h127.0.0.1 -P3307

Post a Comment

0 Comments