Closed ycyin closed 2 months ago
文章说的是在CentOS环境下操作没有任何问题,后来我在Win10系统的wsl2 ubuntu子系统中操作会有兼容性问题:
/var/lib/mysql
后,启动报错Error setting file permissions forca-key.pem and ca.pem
类似,需要将对应文件的权限属性在windows上改为只读。MYSQL_ROOT_PASSWORD
会失效,只能启动后进去手动设置了。
https://stackoverflow.com/questions/56822246/docker-instance-of-mysql-is-not-setting-root-password-any-login-without-a-pas
docker run --name mysql -p 3306:3306 --privileged \
-e MYSQL_ROOT_PASSWORD=root \
-v /mnt/d/devEnv/dockervolume/mysql/data:/var/lib/mysql \
-v /mnt/d/devEnv/dockervolume/mysql/conf:/etc/mysql/conf.d \
-v /mnt/d/devEnv/dockervolume/mysql/log:/var/log/mysql \
-d mysql:5.7.39 --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
https://ladybug.top/%E8%BD%AF%E4%BB%B6%E5%AE%89%E8%A3%85&%E9%85%8D%E7%BD%AE/install-MySQL-and-open-remote-access-in-docker.html