大网数据广告活动
服务器运维问答

MySQL 5.7 bind-address doesn't work

· 52CE 我爱测

I have always successfully set up a remote connection for MySQL 5.5. Today I installed a new server with Ubuntu 16.04 and MySQL 5.7. But for some reasons, I can't make this MySQL installation listen to other hosts but 127.0.0.1 .…

问题原文

原帖链接 · ozahorulia · CC BY-SA 3.0

I have always successfully set up a remote connection for MySQL 5.5.

Today I installed a new server with Ubuntu 16.04 and MySQL 5.7. But for some reasons, I can't make this MySQL installation listen to other hosts but 127.0.0.1.

Here is my /etc/mysql/conf.d/mysql.cnf:

[mysqld]
bind-address = 0.0.0.0

I couldn't connect to this MySQL server from a remote host, and when I checked my netstat, I realized that MySQL listens to connections from localhost only.

lsof -Pni :3306 output is:

COMMAND  PID  USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
mysqld  5302 mysql   25u  IPv4  37280      0t0  TCP 127.0.0.1:3306 (LISTEN)

What is the problem?

已采纳解答

原帖链接 · Linuxx · CC BY-SA 3.0

They changed the MySQL package so that the bind parameter is in /etc/mysql/mysql.conf.d/mysqld.cnf now. Please change the bind parameter there and remove anything you placed in /etc/mysql/conf.d/mysql.cnf.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2016-06-05)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。