#!/bin/bash
docker stop redmineMySQL
docker rm -f redmineMySQL
docker run --privileged=true \
-idt \
-p 3307:3306 \
--name redmineMySQL \
--restart=always \
-v /home/mysql/data:/var/lib/mysql \
-v /home/mysql/conf/my.cnf:/etc/mysql/my.cnf \
-e TZ='Asia/Shanghai' \
-e MYSQL_ROOT_PASSWORD=xxxxxxx \
-e MYSQL_USER=redmine \
-e MYSQL_PASSWORD=xxxxxxx \
-e MYSQL_DATABASE=redmine_production \
mysql:5.7.27
sleep 3s
docker logs redmineMySQL
这里只需给已创建的redmine用户权限即可
########CREATE USER 'redmine'@'%' IDENTIFIED BY 'Wicture@2488';########
########CREATE DATABASE IF NOT EXISTS `redmine_production` DEFAULT CHARACTER SET `utf8` COLLATE `utf8_general_ci`;########
GRANT ALL PRIVILEGES ON *.* TO 'redmine'@'%';
flush privileges;
坑:ssl error
解决办法:
将mysql的my.cnf文件映射出来,在mysqld下添加skip_ssl之后重启mysql
标签:redmineMySQL,mysql,startRedmineMySQL,cnf,--,redmine,MYSQL From: https://www.cnblogs.com/zhangdapangzo/p/17505131.html