【问题标题】:Why ERROR 1045 (28000): Access denied in ProxySQL server?为什么 ERROR 1045 (28000): Access denied in ProxySQL server?
【发布时间】:2020-04-26 09:27:49
【问题描述】:

我已经在 MySQL master 上设置了 proxysql 用于读写分离。 MySQL主从,proxysql服务器正在运行,但是proxysql终端出现Access denied错误。

[devops@DRMBUST05 ~]$ mysql -uproxysql -p**** -h 127.0.0.1 -P 6033
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.5.30 (ProxySQL)

Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> show databases;
ERROR 1045 (28000): Access denied for user 'proxysql'@'172.17.222.175' (using password: YES)
mysql>

这里是proxysql.log

2020-04-26 16:37:16 mysql_connection.cpp:835:handler(): [ERROR] Failed to mysql_real_connect() on 172.17.222.175:33003 , FD (Conn:31 , MyDS:31) , 1045: Access denied for user 'proxysql'@'172.17.222.175' (using password: YES).
2020-04-26 16:37:16 mysql_connection.cpp:835:handler(): [ERROR] Failed to mysql_real_connect() on 172.17.222.175:33003 , FD (Conn:31 , MyDS:31) , 1045: Access denied for user 'proxysql'@'172.17.222.175' (using password: YES).
2020-04-26 16:37:16 mysql_connection.cpp:835:handler(): [ERROR] Failed to mysql_real_connect() on 172.17.222.175:33003 , FD (Conn:31 , MyDS:31) , 1045: Access denied for user 'proxysql'@'172.17.222.175' (using password: YES).

我确定我可以使用proxysql中配置的用户名和密码连接到MySQL master和slave,如下所示:

[devops@DRMBUST05 ~]$ mysql -u proxysql -h 127.0.0.1 --port 33003 -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1152
Server version: 8.0.16 MySQL Community Server - GPL

Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| devops             |
| information_schema |
| mysql              |
| performance_schema |
| sys                |
+--------------------+
5 rows in set (0.00 sec)

mysql>

这是因为我在 MySQL master 上安装了 proxysql 吗?有人知道出了什么问题吗?任何提示将不胜感激。

【问题讨论】:

  • 我在 MySQL 8.0.20 和 ProxySQL 2.0.12 中遇到了完全相同的问题。我发现的一个发现是,没有密码的用户能够毫无问题地进行身份验证。换句话说,创建一个没有密码的新用户,您将能够直接连接到 MySQL 并通过 ProxySQL。我试图弄清楚它是否与caching_sha2_password 与本机密码或UTF8 或其他有关。

标签: mysql high-availability proxysql


【解决方案1】:

ProxySQL 不支持 MySQL 8 中引入的 caching_sha2_password。

您需要:

  • 在proxysql中设置admin-hash_passwords=false,或者

  • 将 MySQL 中该用户的身份验证机制更改为 mysql_native_password。 (旧的认证机制)。

related github issue

【讨论】:

    猜你喜欢
    • 2021-05-14
    • 2021-12-30
    • 2015-03-20
    • 1970-01-01
    • 2012-10-30
    • 2018-08-17
    • 1970-01-01
    • 1970-01-01
    • 2019-04-06
    相关资源
    最近更新 更多