错误号码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 链接:
错误号码2003 Can‘t connect to MySQL server on ‘106.12.220.19‘ (0)

[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