使用官方安装脚本自动安装
安装命令如下: 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 -psystemctl start docker 即可
https://github.com/4x99/code6/blob/master/doc/deploy-docker.md
