MySql8.0-Docker下安装及配置
docker pull mysql:8.0
docker run \
--name mysql8.0 \
-p 3307:3306 \
-e MYSQL_ROOT_PASSWORD=root \
-d mysql:8.0 \
--lower_case_table_names=1
rm -rf /home/admin/etc/mysql8_0 /home/admin/lib/mysql8_0
mkdir -p /home/admin/etc /home/admin/lib
docker cp mysql8.0:/etc/mysql /home/admin/etc/mysql8_0
docker cp mysql8.0:/var/lib/mysql /home/admin/lib/mysql8_0
chmod -R 777 /home/admin/etc/mysql8_0 /home/admin/lib/mysql8_0
docker stop mysql8.0
docker rm mysql8.0
docker run \
-d \
--name mysql8.0 \
--privileged=true \
--network common-network \
-p 3307:3306 \
-e MYSQL_ROOT_PASSWORD=root \
-v /home/admin/lib/mysql8_0:/var/lib/mysql \
-v /home/admin/etc/mysql8_0:/etc/mysql \
mysql:8.0 \
--lower_case_table_names=1