拉取镜像
1 2 3 4
| docker pull mysql/mysql-server:5.7
docker pull mysql/mysql-server:latest
|
下载设置安装mysql5.7
1
| docker run --restart=always --name=mysql --privileged=true -p 3306:3306 -v /Users/liuqi/home/dev/hock/docker_volumes/mysql5.7:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=123456 -d mysql/mysql-server:5.7
|
进入容器病修改配置
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| docker exec -it mysql bash
mysql -uroot -p 123456
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '123456';
CREATE USER 'root'@'%' IDENTIFIED BY 'root';
GRANT ALL ON *.* TO 'root'@'%'; FLUSH PRIVILEGES;
ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY '123456';
FLUSH PRIVILEGES;
|
arm64 警告
image may have poor performance,or fail, if run via emulation
在模拟环境下,性能降低, 如果不喜欢,装最新版即可。