命令:
docker search MysqL
2、安装MysqL
命令:
docker pull MysqL
3、启动MysqL
命令:
docker run --name MysqLserver -v $PWD/conf:/etc/MysqL/conf.d -v $PWD/logs:/logs -v $PWD/data:/var/lib/MysqL -e MysqL_ROOT_PASSWORD=123456 -d -i -p 3306:3306 MysqL:latest
命令:
docker exec -it MysqLserver bash
命令:
MysqL -uroot -p
5、开启远程访问权限
命令:
use MysqL;
命令:
select host,user from user;
命令:
ALTER USER 'root'@'%' IDENTIFIED WITH MysqL_native_password BY '123456';
命令:
flush privileges;