使用code6快速搭建一个github监控系统

centos安装docker

使用官方安装脚本自动安装

安装命令如下:
curl -fsSL https://get.docker.com | bash -s docker --mirror Aliyun

使用流程

这里是使用code6这个工程的docker模式。
克隆代码

git clone https://github.com/4x99/code6.git

使用 Dockerfile 创建镜像

cd code6
docker build -t code6 .
docker run -d \
> -p 666:80 \
> -e MYSQL_HOST=172.17.0.1 \
> -e MYSQL_PORT=3306 \
> -e MYSQL_DATABASE=code6 \
> -e MYSQL_USERNAME=xxx \
> -e MYSQL_PASSWORD=xxxx \
> --name code6-server code6

问题 一

写入失败:
SQLSTATE[HY000] [1130] Host ‘172.17.0.2’ is not allowed to connect to this MySQL server

参考:https://blog.csdn.net/qq_32786873/article/details/79225039


改表法。可能是你的帐号不允许从远程登陆,只能在localhost。这个时候只要在localhost的那台电脑,登入mysql后,更改 "mysql" 数据库里的 "user" 表里的 "host" 项,从"localhost"改称"%"

mysql -u root -p

mysql>use mysql;
mysql>update user set host = '%' where user = 'root';
mysql>select host, user from user;

问题 二

解决MySQL登录报ERROR 1045 (28000): Access denied for user ‘root’@‘localhost’ (using password: YES)的问题

参考:https://blog.csdn.net/qq_32786873/article/details/79225039

执行命令:

停止mysql数据库:systemctl stop mysqld
启动MySQL,以不检查权限的方式启动:
mysqld --skip-grant-tables &

刷新权限:flush privileges;

退出mysql:exit或quit

使用root用户重新登录mysql
mysql -uroot -p

问题三

[root@VM-0-16-centos django-crud-mysql-connector-master]# docker ps
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

systemctl start docker 即可

参考:

https://github.com/4x99/code6/blob/master/doc/deploy-docker.md

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值