1、搜索mysql镜像
docker search mysql
2.拉取镜像
docker pull docker pull docker.io/centos/mysql-57-centos7
3.创建容器
docker run --name=unicorn_mysql -p 3306:3306 -e MYSQL_ROOT_PASSWORD=root1234 -d f83a2938370c
(#f83a2938370c为镜像id)
4.进入mysql容器
docker exec -ti 353abed926df /bin/bash
5.赋予权限
ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY '123456';