Почему ОШИБКА 1045 (28000): Отказано в доступе к серверу ProxySQL?

Я настроил proxysql на мастере MySQL для разделения чтения и записи. Мастер и подчиненный MySQL, сервер proxysql работает, однако я получил ошибку Access denied в терминале proxysql.

[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).

Я уверен, что смогу подключиться к главному и подчиненному MySQL с именем пользователя и паролем, настроенным в proxysql, например:

[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>

Это потому, что я установил proxysql на мастере MySQL? Кто-нибудь знает, что случилось? Любые советы будут оценены.


person liaogx    schedule 26.04.2020    source источник
comment
Отвечает ли это на ваш вопрос? MySQL ERROR 1045 (28000): Доступ запрещен для пользователь 'bill'@'localhost' (используя пароль: YES)   -  person Kalana    schedule 26.04.2020
comment
У меня точно такая же проблема с MySQL 8.0.20 и ProxySQL 2.0.12. Одно открытие, которое я обнаружил, заключается в том, что пользователи без паролей могут проходить аутентификацию без проблем. Другими словами, создайте нового пользователя без пароля, и вы сможете прекрасно подключаться напрямую к MySQL и через ProxySQL. Я пытаюсь выяснить, связано ли это с caching_sha2_password по сравнению с собственным паролем, UTF8 или чем-то еще.   -  person Jonathan Oliver    schedule 28.05.2020


Ответы (1)


ProxySQL не поддерживает caching_sha2_password, который появился в MySQL 8.

Вам нужно либо:

  • установить admin-hash_passwords=false в proxysql или

  • измените механизм аутентификации для этого пользователя в MySQL на mysql_native_password. (Старый механизм аутентификации).

связанная проблема с github

person izzy    schedule 29.10.2020