You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Windows Server下多实例MySQL绑定IP失败,改端口正常求助

Windows Server下MySQL实例配置bind-address后连接失败

环境与问题概述

  • 两台部署MySQL/phpMyAdmin的Windows Server:一台为生产服务器(运行正常),一台为备份服务器(配置D-1、D-7两个实例,用于生产环境D-1和D-7数据复制)
  • 备份服务器上的MySQL实例,仅修改端口不绑定IP时,可通过phpMyAdmin和MySQL命令行正常连接
  • 在my.ini中添加bind-address配置绑定指定IP后,实例连接失败;已在网卡高级TCP/IP配置中添加第二个IP,服务状态显示正常

错误信息

phpMyAdmin连接错误

mysqli::real_connect(): (HY000/2002):
No connection could be established because the target computer expressly refused it

MySQL命令行连接错误

C:\Program Files\MySQL\MySQL Server 8.0\bin>mysql 111.11.11.111 -u root -p
Enter password: *********
ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost:3306' (10061)

C:\Program Files\MySQL\MySQL Server 8.0\bin>mysql 111.11.11.222 -u root -p
Enter password: *********
ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost:3306' (10061)

相关配置示例

未绑定IP时的配置

D-1实例my.ini

[client]
no-beep

port=3306

[mysqld]
# The TCP/IP Port the MySQL Server will listen on
port=3306
# Path to installation directory. All paths are usually resolved relative to this.
basedir=C:\Program Files\MySQL\MySQL Server 8.0\\

# Path to the database root
datadir=D:\MySQLDatafiles\\ 

D-7实例myd7.ini

[client]
no-beep

port=3307

[mysqld]
# The TCP/IP Port the MySQL Server will listen on
port=3307
# Path to installation directory. All paths are usually resolved relative to this.
basedir=C:\Program Files\MySQL\MySQL Server 8.0j4

# Path to the database root
datadir=D:\MySQLDatafilesJ4

添加bind-address后的配置示例

[mysqld]
# The TCP/IP Port the MySQL Server will listen on
port=3306
bind-address=111.11.11.111
# Path to installation directory. All paths are usually resolved relative to this.
basedir=C:\Program Files\MySQL\MySQL Server 8.0j4

[mysqld]
# The TCP/IP Port the MySQL Server will listen on
port=3306
bind-address=111.11.11.222
# Path to installation directory. All paths are usually resolved relative to this.
basedir=C:\Program Files\MySQL\MySQL Server 8.0j4

疑问

无法定位绑定IP后连接失败的原因,请求排查思路或解决方案,如需更多信息可补充。


内容的提问来源于stack exchange,提问作者Moinnou

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.07 11:20:33