错误号码2003 Can‘t connect to MySQL server on ‘106.12.220.19‘ (0)

sqlyog客户端链接MySQL数据库,报错:错误号码2003 Can't connect to MySQL server on 'xxxxxx' (0)

我的解决思路:

1、IP正常,连接不上与IP无关

2、mysql链接的IP是否就是liunx的IP ,就是同一ip

3、root 的houst为 %

4、port的端口号是否与客户端链接的客户端一致,该配置文件在

clinent 链接:

[mysqld]   vim /etc/my.cnf 
# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M

# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin
# These are commonly set, remove the # and set as required.
skip-name-resolve
basedir = /usr/local/mysql
datadir = /usr/local/mysql/data
socket = /tmp/mysql.sock
log-error = /usr/local/mysql/data/error.log
pid-file = /usr/local/mysql/data/mysql.pid
tmpdir = /tmp
port = 3306   #要与客户端链接一致
#lower_case_table_names = 1
# server_id = .....
# socket = .....
#lower_case_table_names = 1
max_allowed_packet=32M
default-authentication-plugin = mysql_native_password
#lower_case_file_system = on
#lower_case_table_names = 1
log_bin_trust_function_creators = ON
# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
"/etc/my.cnf" 34L, 1205C  

vim /etc/my.cnf 

 

port = n

为MySQL程序指定一个TCP/IP通信端口(通常是3306端口)。

拓展阅读:https://www.cnblogs.com/wajika/p/6323026.html

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值