Answer a question

I have setup the proxysql on MySQL master for read and write splitting. MySQL master and slave, proxysql server is running, however, I got an Access denied error in the proxysql terminal.

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

here is the 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).

I'm sure I can connect to MySQL master and slave with the username and password configured in proxysql, like this:

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

Is this because I installed the proxysql on MySQL master? Does anybody know what's wrong? Any tips will be appreciated.

Answers

ProxySQL doesn’t support caching_sha2_password which was introduced into MySQL 8.

You need to either:

  • set admin-hash_passwords=false in proxysql, or

  • change the authentication mechanism for that user in MySQL to mysql_native_password. (The old authentication mechanism).

related github issue

Logo

华为、百度、京东云现已入驻,来创建你的专属开发者社区吧!

更多推荐