docker mysql 出现错误
连接数据库出现,docker 容器又能正常进入 正常进入mysql
Got a packet bigger than ‘max_allowed_packet’ bytes
如果你设置了这个
set global max_allowed_packet=524288000; #修改 512M
后面导致
mysql error
pymysql.err.OperationalError: (1045, "Access denied for user 'root'@'116.24.x.x' (using password: YES)")
systemctl status firewalld 查看服务器状态
linux server error
proxy 'proxy-mysql' has no server available
Warning] IP address '116.24.x.x' could not be resolved: Temporary failure in name resolution
2019-09-26T03:59:35.102944016Z 2019-09-26T03:59:35.102658Z 31 [Warning] IP address '116.24.x.x' could not be resolved: Name or service not known
iptables: No chain/target/match by that name
docker logs -f -t --tail 100 f9ceeb20004b
查看docker 日志
Error response from daemon: Cannot restart container node1: driver failed programming external connectivity on endpoint node1 (4c26d34672512580bd71409ff0a3002b2302f8a524424c): (iptables failed: iptables --wait -t nat -A DOCKER -p tcp -d 0/0 --dport 3306 -j DNAT --to-destination 172.18.0.2:3306 ! -i br-1c1d57af1521: iptables: No chain/target/match by that name.
解决方法:请进docker mysql 容器内将数据库设置可连接权限为允许所有ip进行连接
使用过的命令:
ifconfig docker 查看docker使用的网段
service docker restart 重启docker服务
systemctl restart docker 重启docker服务
systemctl status firewalld 查看服务器状态
systemctl restart iptables.service 重启iptables
docker network create
docker network connect
docker network ls
docker network rm 删除网段
docker network disconnect
docker network inspect id 检查网段
docker logs --since 30m 30651fba29f4 查看docker30分钟日志
docker logs -f -t --tail 100 f9ceeb20004b 查看docker日志
docker exec -it f9ceeb20004b /bin/bash 进入容器
在使用Docker运行MySQL时遇到'Got a packet bigger than 'max_allowed_packet' bytes'错误。尽管能正常进入MySQL容器,但连接数据库时出现问题。为解决此问题,尝试了创建、连接、列出、删除Docker网络,以及断开网络连接,并通过`docker network inspect`检查网络状态。此外,通过`docker logs`命令查看了容器的日志,包括最近30分钟的记录和尾部100条信息,并通过`docker exec`进入了容器进行进一步排查。
2744

被折叠的 条评论
为什么被折叠?



