数据库
首页 > 数据库> > docker安装mysql:5.7

docker安装mysql:5.7

作者:互联网

安装

docker pull mysql:5.7
docker images

image

运行

docker run -itd --name task-for-student -p 3306:3306 -e MYSQL_ROOT_PASSWORD=密码 mysql:5.7
docker ps

image

设置MySQL登录密码和远程访问

进入docker中的MySQL

docker exec -it task-for-student bash

登录

mysql -uroot -p

设置

use mysql;
update user set authentication_string = password('密码') where user = 'root';
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '密码' WITH GRANT OPTION;

标签:5.7,mysql,密码,student,MySQL,docker
来源: https://www.cnblogs.com/jarico/p/16694850.html