MAC电脑docker容器中启动mysql的方法
时间:2020-09-22 19:40:07
作者:重庆seo小潘
来源:
docker下载镜像docker pull mysqldocker images创建容器docker run -d -e MYSQL_ROOT_PASSWORD=root --name mysql57 -v /usr/local/docker_mysql/57/data/mysql:/var/lib/mysql -p 3306:3306 mysql --character-set-server=utf8mb4 --collation-server=utf8m
docker下载镜像docker pull mysqldocker images创建容器docker run -d -e MYSQL_ROOT_PASSWORD=root --name mysql57 -v /usr/local/docker_mysql/57/data/mysql:/var/lib/mysql -p 3306:3306 mysql --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci --lower_case_table_names=1docker exec -it mysql57 bash如果连接Docker启动的mysql出现报错:ERROR 2059 (HY000): Authentication plugin caching_sha2_password’ cannot be loaded解决办法ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'root';ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'root';SELECT plugin FROM mysql.user WHERE User = 'root';停止docker stop mysql启动docker start msyql推荐:《mysql视频教程》以上就是MAC电脑docker容器中启动mysql的方法的详细内容,更多请关注小潘博客其它相关文章!