群晖docker安装mysql流程
- 下载mysql 5.7.37 镜像
- 启动镜像(配置MySQL root密码:MYSQL_ROOT_PASSWORD root123) 不配置密码会导致容器启动失败
- 配置系统源(使用下述:中科大源)
deb http://mirrors.ustc.edu.cn/debian buster main contrib non-free
deb http://mirrors.ustc.edu.cn/debian buster-updates main contrib non-free
deb http://mirrors.ustc.edu.cn/debian buster-backports main contrib non-free
deb http://mirrors.ustc.edu.cn/debian-security/ buster/updates main contrib non-free - apt-get update
- apt-get install vim -y
- 修改数据库配置允许远程访问
vim /etc/mysql/mysql.conf.d/mysqld.cnf (bind-address = 0.0.0.0) - 重启数据库镜像
- 进入数据库mysql添加远程用户
grant all privileges on . to ‘root’@‘%’ identified by ‘password’;
flush privileges;