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

    科技2026-02-06  1

    文章目录

    centos安装docker使用流程问题 一问题 二问题三参考:

    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

    Processed: 0.024, SQL: 9