【问题标题】:MariaDB: error 1045 when doing GRANT ALLMariaDB:执行 GRANT ALL 时出现错误 1045
【发布时间】:2015-01-09 21:19:44
【问题描述】:

我希望有人可以在这里帮助我。使用 Centos 7,我发现所有安装文档都说使用 MariaDB 而不是 mysql,这很好,但我似乎无法启用远程访问。我使用了“GRANT ALL ON . 给用户@'address' 由 'your-root-password' 识别;"并刷新权限并重新启动服务。我仍然无法通过远程终端连接我得到 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

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

【问题讨论】:

    标签: mariadb mysql-error-1045 centos7


    【解决方案1】:

    您可能想调查此链接: 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
    

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

    【讨论】:

      猜你喜欢
      • 2020-04-02
      • 1970-01-01
      • 2020-07-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多