1.创建mysql容器拉取容器docker pull mysql:5.7创建容器-v /www/docker/mysql5.7/log:/var/log/mysql -v /www/docker/mysql5.7/data:/var/lib/mysql -v /www/docker/mysql5.7/conf:/etc/mysql/conf.d -e MYSQL_ROOT_PASSWORD=root -d mysql:5.72.设置容器开机启动docker update mysql-5.7 --restart=always3.设置root用户远程访问docker exec -it mysql-5.7 /bin/bash登入mysqlmysql -uroot -p输入密码 rootuse mysql修改密码update user set authentication_string = password('yourpassword'), password_expired = 'N', password_last_changed = now() where user = 'root'