docker部署mysql8 并修改加密规则 使用navicat连接

创建容器

docker run -d --name mysql -p 3306:3306 -e MYSQL_ROOT_PASSWORD=server mysql

进入容器并修改权限

docker exec -it mysql /bin/bash

进入容器的MySQL

mysql -u root -p

GRANT ALL ON *.* TO 'root'@'%';

flush privileges;

ALTER USER 'root'@'localhost' IDENTIFIED BY 'password' PASSWORD EXPIRE NEVER;

ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'server';

flush privileges;

你可能感兴趣的:(docker部署mysql8 并修改加密规则 使用navicat连接)