Error response from daemon: driver failed programming external connectivity on endpoint mysql (0b3324391f54cd0137ff7a9da6ed145656b187dfb984d507ca62252a54d47245): (iptables failed: iptables –wait -t nat -A DOCKER -p tcp -d 0/0 –dport 3306 -j DNAT –to- destination 172.17.0.2:3306 ! -i docker0: iptables: No chain/target/match by that name.
Error reproduction: After starting mysql, close the firewall, and then restart mysql (docker restart mysql), the above error occurs.
Reason: After we start Docker, we operate the firewall firewalld, and the above error will occur
Solution: restart docker (systemctl restart docker), restart docker service and regenerate custom chain DOCKER
Why can it be solved:
The custom chain DOCKER defined when the docker service starts, when the centos7 firewall is cleared,
The bottom layer of firewall is to use iptables for data filtering, which is built on top of iptables, which may conflict with Docker.
firewalld
Rules that will be removed from iptables when starting or restarting DOCKER
, thus affecting the normal working of Docker.
When you are using Systemd, it firewalld
will start before Docker, but if you operate after Docker has started firewalld
, you will need to restart the Docker process.
Read More:
- [Solved] Error response from daemon: driver failed programming external connectivity on endpoint mysql
- [Solved] Error response from daemon: Conflict. The container name “/mysql is already in use by container
- Using Mybatis to connect to the database error: Loading class `com.mysql.jdbc.Driver‘. This is deprecated. The new driver···
- MySql Install Error: Can‘t connect to local MySQL server through socket ‘/tmp/mysql.sock‘
- Mysql Flashback Warning: C:\Program Files\MySQL\MySQL Server 8.0\bin\mysql.exe
- [Solved] error {dataSource-1} init error java.sql.SQLException: com.mysql.cj.jdbc.Driver
- How to Solve MYSQL Error: Failed to start MySQL 8.0 database server
- [Solved] ERROR 2002 (HY000): Can’t connect to local MySQL server through socket’/var/lib/mysql/mysql.sock’ (2)
- [Solved] MYSQL Command Execute Error: Can ‘t connect to local MySQL server through socket ‘/tmp/mysql.sock ‘(2) “
- [Solved] MYSQL Error: ERROR! MySQL server PID file could not be found!
- How to Solve can‘t connect to local mysql server through socket ‘/var/lib/mysql/mysql.sock‘
- [Solved] CentOS installs MySQL and starts MySQL with error 2002 (HY000)
- [Solved] mysql 2003 remote access failed mysql8 configure remote access
- ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’
- MySQL Install Error: MySQL error 1042: Unable to connect to any of the specified MySQL hosts
- How to Fix MySQL ERROR 1130 (HY000): Host ‘XXXX’ is not allowed to connect to this MySQL server
- C# Connect MYSQL Error: MySql.Data.MySqlClient.MySqlException:“SSL Connection error.”
- mac brew install mysql ‘/tmp/mysql.sock’ (2) [How to Solve]
- MYSQL Insert Data Error: check the manual that corresponds to your MySQL server version for the right syntax
- [Solved] Django configures MySQL Error: NameError: name ”_MySQL ‘is not defined