1.docker pull mysql:8.0.16
2.sudo docker run --name mysql8.0 -e MYSQL_ROOT_PASSWORD=root123456 -p 3306:3306 -d mysql:8.0.16
3.systemctl stop firewalld
4.docker ps
5.docker exec -it 容器号 bash
6.mysql -u root -p 进入mysql输入密码:root123456
7.use mysql;
8.GRANT ALL ON *.* TO
'root'
@
'%'
;
9.ALTER USER
'root'
@
'%'
IDENTIFIED WITH mysql_native_password BY
'123456'
;
10.
flush privileges;