#在opt新建挂载目录 cd /opt #-v 显示创建的目录名 mkdir -vp docker_cfg/mysql/data docker_cfg/mysql/logs docker_cfg/mysql/conf # 运行Docker mysql docker run -p 3306:3306 --name MySQLDocker -v $PWD/conf/my.cnf:/etc/mysql/conf.d/my.cnf -v $PWD/logs:/var/log/mysql -v $PWD/data:/var/lib/mysql
-e MYSQL_ROOT_PASSWORD=123456 -d mysql:5.7