ycyin / giscus-comment

个人博客-敲代码的小松鼠
https://ycyin.eu.org
1 stars 1 forks source link

[Vssue]在Docker中安装MySQL5.7并开启远程访问(附授权和修改密码方式) | 敲代码的小松鼠 #7

Closed ycyin closed 2 months ago

ycyin commented 2 years ago

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

ycyin commented 2 years ago

文章说的是在CentOS环境下操作没有任何问题,后来我在Win10系统的wsl2 ubuntu子系统中操作会有兼容性问题:


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