MySQL 错误 111(无法连接到“x.x.x.x”上的 MySQL 服务器)

时间:2021-01-08 19:04:22

标签: mysql ubuntu server

我在 Ubuntu 20.04 机器上运行 MySQL。我正在尝试使用外部连接连接到它,但遇到错误 111(无法连接到“x.x.x.x”上的 MySQL 服务器)。我知道这应该是拒绝,我发现其他线程说要评论(或更改)/etc/mysql/mysql.conf.d 中的绑定地址行,但是这样做对我没有任何影响。我不知道我在这里错过了什么。我曾尝试吸引新用户并再试一次,但我认为这无助于解决问题,因为这是直接拒绝连接。

这是我的完整/etc/mysql/mysql.conf.d

#
# The MySQL database server configuration file.
#
# One can use all long options that the program supports.
# Run program with --help to get a list of available options and with
# --print-defaults to see which it would actually understand and use.
#
# For explanations see
# http://dev.mysql.com/doc/mysql/en/server-system-variables.html

# Here is entries for some specific programs
# The following values assume you have at least 32M ram

[mysqld]
#
# * Basic Settings
#
user        = mysql
pid-file    = /var/run/mysqld/mysqld.pid
socket  = /var/run/mysqld/mysqld.sock
port        = 3306
datadir = /var/lib/mysql


# If MySQL is running as a replication slave, this should be
# changed. Ref https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_tmpdir
# tmpdir        = /tmp
#
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
# bind-address       = 0.0.0.0
#
# * Fine Tuning
#
key_buffer_size     = 16M
# max_allowed_packet    = 64M
# thread_stack      = 256K

# thread_cache_size       = -1

# This replaces the startup script and checks MyISAM tables if needed
# the first time they are touched
myisam-recover-options  = BACKUP

# max_connections        = 151

# table_open_cache       = 4000

#
# * Logging and Replication
#
# Both location gets rotated by the cronjob.
#
# Log all queries
# Be aware that this log type is a performance killer.
# general_log_file        = /var/log/mysql/query.log
# general_log             = 1
#
# Error log - should be very few entries.
#
log_error = /var/log/mysql/error.log
#
# Here you can see queries with especially long duration
# slow_query_log        = 1
# slow_query_log_file   = /var/log/mysql/mysql-slow.log
# long_query_time = 2
# log-queries-not-using-indexes
#
# The following can be used as easy to replay backup logs or for replication.
# note: if you are setting up a replication slave, see README.Debian about
#       other settings you may need to change.
# server-id     = 1
# log_bin           = /var/log/mysql/mysql-bin.log
# binlog_expire_logs_seconds    = 2592000
max_binlog_size   = 100M
# binlog_do_db      = include_database_name
# binlog_ignore_db  = include_database_name

如您所见,不仅 bind-address 被注释掉了,而且在这样做之前我还尝试将其设置为 0.0.0.0。还有什么我可以检查的吗?非常感谢任何帮助。

0 个答案:

没有答案
相关问题