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'@'%';