1

我希望有人可以在这里帮助我。使用 Centos 7,我发现所有安装文档都说使用 MariaDB 而不是 mysql,这很好,但我似乎无法启用远程访问。我使用了“GRANT ALL ON . to user@'address' IDENTIFIED BY'你的根密码';" 并刷新权限并重新启动服务。我仍然无法通过远程终端连接我得到 ERROR 1045 (28000): Access denied for user username。

所以我发现另一篇文章说我应该去我的 my.cnf 文件并确保我的绑定设置设置正确等等。

https://mariadb.com/kb/en/mariadb/documentation/getting-started/configuring-mariadb-for-remote-client-access/

根据本文显示的内容,我的 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

我想知道是否有其他人可能知道这是怎么回事。谢谢。

4

1 回答 1

0

您可能想调查此链接: http ://www.versatilewebsolutions.com/blog/2015/05/dealing-with-mariadb-plugin-unixsocket-is-not-loaded.html

本质上,MariaDB 切换到unix_socket身份验证作为默认身份验证插件。要绕过它,请连接到您的 MariaDB 服务器并执行以下查询:

USE mysql;
UPDATE user SET plugin='' WHERE User = 'root';
FLUSH PRIVILEGES;
exit

这将禁用套接字身份验证并切换回标准身份验证。我不认为这被推荐用于生产。

于 2015-09-23T02:07:57.460 回答