我希望有人可以在这里帮助我。使用 Centos 7,我发现所有安装文档都说使用 MariaDB 而不是 mysql,这很好,但我似乎无法启用远程访问。我使用了“GRANT ALL ON . to user@'address' IDENTIFIED BY'你的根密码';" 并刷新权限并重新启动服务。我仍然无法通过远程终端连接我得到 ERROR 1045 (28000): Access denied for user username。
所以我发现另一篇文章说我应该去我的 my.cnf 文件并确保我的绑定设置设置正确等等。
根据本文显示的内容,我的 my.cnf 文件与应有的完全不同。不包含绑定地址或跳过网络或端口或任何东西。它看起来像下面。
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
# Settings user and group are ignored when systemd is used.
# If you need to run mysqld under a different user or group,
# customize your systemd unit file for mariadb according to the
# instructions in http://fedoraproject.org/wiki/Systemd
[mysqld_safe]
log-error=/var/log/mariadb/mariadb.log
pid-file=/var/run/mariadb/mariadb.pid
#
# include all files from the config directory
#
!includedir /etc/my.cnf.d
我想知道是否有其他人可能知道这是怎么回事。谢谢。