赞
踩
centos7.7
mysql5.7
yearning2.2.0
CREATE DATABASE yearning CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
#修改密码策略
set global validate_password_length=6;
set global validate_password_policy=0;
#给数据库授权
grant all on yearning.* to 'yearning'@'%' identified by '123321';
新手可能需要学习下docker,百度安装过程很多。我此处环境与其他服务共用,docker环境已经具备,安装步骤省略。
cd /data/yearning/Yearning-go
docker build -t yearning:v1.0 .
注意在命令最后有个英文字符的点 “.”
docker run -d \
--name yearning \
--restart always \
-p 8000:8000 \
-e MYSQL_USER=yearning \
-e MYSQL_ADDR=10.120.28.143:3306 \
-e MYSQL_PASSWORD=123321 \
-e MYSQL_DB=yearning \
yearning:v1.0
此处出现问题大概率是容器连接数据库出现了问题,直接查看容器的日志就行:
docker logs yearning
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。