Troubleshooting MySQL Remote Connection Failure Caused by skip_networking Configuration
This article walks through a step‑by‑step investigation of why a MySQL 8.0 instance cannot be accessed remotely after adding configuration variables, identifies the skip_networking setting as the root cause, and explains how to correct the configuration for proper TCP/IP connections.
Author: Zhang Hao, DBA, mainly responsible for MySQL fault handling and DMP product support.
1 Background
A client’s testing colleague deployed MySQL 8.0 locally and added several variables to the configuration file; after restarting the database, remote connections to the database failed.
2 Investigation
1 Check Database Process Status
[root@hao-3 ~]# ps -ef|grep mysqld |grep 8888
actiont+ 25825 1 0 02:10 ? 00:00:01 /opt/mysql/base/8.0.28/bin/mysqld --defaults-file=/opt/mysql/etc/8888/my.cnf --daemonize --pid-file=/opt/mysql/data/8888/mysqld.pid --user=actiontech-mysql --socket=/opt/mysql/data/8888/mysqld.sock --port=88882 Check Service TCP Connection Status
Use the netstat command to view the TCP connections of the database service; the output is empty.
[root@hao-3 ~]# ps -ef|grep mysqld|grep 8888
actiont+ 25825 1 0 02:10 ? 00:00:05 /opt/mysql/base/8.0.28/bin/mysqld --defaults-file=/opt/mysql/etc/8888/my.cnf --daemonize --pid-file=/opt/mysql/data/8888/mysqld.pid --user=actiontech-mysql --socket=/opt/mysql/data/8888/mysqld.sock --port=8888
[root@hao-3 ~]# netstat -lantup |grep 25825 // view process
[root@hao-3 ~]#
[root@hao-3 ~]# netstat -lantup |grep 8888 // view port
[root@hao-3 ~]#3 Check Database Port
The database port query returns 0.
[root@hao-3 ~]# /opt/mysql/base/8.0.28/bin/mysql -uroot -p1 -S /opt/mysql/data/8888/mysqld.sock
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 11
Server version: 8.0.28 MySQL Community Server - GPL
...
mysql> show variables like 'port';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| port | 0 |
+---------------+-------+
1 row in set (0.00 sec)4 Check Configuration File
The client’s configuration contains the skip_networking variable, which disables TCP/IP connections.
mysql> show variables like '%networking%';
+-----------------+-------+
| Variable_name | Value |
+-----------------+-------+
| skip_networking | ON |
+-----------------+-------+
1 row in set (0.00 sec)
[root@hao-3 ~]# grep skip /opt/mysql/etc/8888/my.cnf
skip_external_locking = 1
skip_name_resolve = 1
skip_replica_start = 1
skip_networking=on5 Official Documentation Explanation
skip_networking controls whether MySQL allows TCP/IP connections; it is disabled by default. When enabled, MySQL only accepts local connections and rejects any TCP/IP connections.
Note that when the --skip-grant-tables option is set, skip_networking is also enabled by default, thereby disabling all remote connections.
3 Conclusion
The skip_networking variable should be configured according to business needs: it is strongly recommended for MySQL instances that only need local access, but for most databases that require remote access it should remain disabled (default). The variable cannot be changed dynamically; it requires editing the configuration file and restarting the MySQL service.
Recommended Reading
Technical Share | MySQL Multi‑Channel Master‑Master Replication Disaster Recovery Solution
Fault Analysis | MySQL Migration Cannot Quickly Import Data
Technical Translation | Thank‑You Letter to MySQL 8.2 Contributors
Technical Translation | MySQL 8.2 Supports Read‑Write Separation!
Technical Translation | MySQL 8.1.0 Introduces InnoDB Cluster Read‑Only Replica
Industry Insight | New Challenges for DBAs in 2023
About SQLE
SQLE is a comprehensive SQL quality management platform covering the entire lifecycle from development to production, supporting major open‑source, commercial, and domestic databases, providing automated workflow capabilities for developers and operations to improve release efficiency and data quality.
SQLE Acquisition
🔗 Github https://github.com/actiontech/sqle
📚 Documentation https://actiontech.github.io/sqle-docs/
💻 Official site https://opensource.actionsky.com/sqle/
👥 WeChat technical community: add administrator WeChat ActionOpenSource
📊 Click the original link to view the comparison of community and enterprise editions: https://actiontech.github.io/sqle-docs/docs/support/compare
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Aikesheng Open Source Community
The Aikesheng Open Source Community provides stable, enterprise‑grade MySQL open‑source tools and services, releases a premium open‑source component each year (1024), and continuously operates and maintains them.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
