docker mysql 安装

docker pull mysql

#启动
docker run --name mysql -p 3306:3306 -e MYSQL_ROOT_PASSWORD=yaoyao1234 -d mysql

#进入容器
docker exec -it mysql bash

#登录mysql
mysql -u root -p
ALTER USER 'root'@'localhost' IDENTIFIED BY 'xxxx1234';

#添加远程登录用户
CREATE USER 'yaoyao'@'%' IDENTIFIED WITH mysql_native_password BY 'xxxx1234';
GRANT ALL PRIVILEGES ON *.* TO 'yaoyao'@'%';

posted @ 2021-11-10 09:19  耀耀王  阅读(21)  评论(0编辑  收藏  举报