Proxysql config initialization

Trying to set up Proxysql via the instructions here:
https://www.percona.com/doc/percona-xtradb-cluster/LATEST/howtos/proxysql-v2.html#pxc-proxysql-v2

Is there a sample config script I could follow? I have a 3-node cluster I want to configure proxy for, so just really need to create a group and three nodes as a minimum I guess. Tried a simple enable command, see below. I can connect to the console ok.

[root@li1038-93 ~]# mysql -uadmin -p --host=localhost --port=6032 --protocol=tcp
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 69
Server version: 5.5.30 (ProxySQL Admin Module)

Copyright (c) 2000, 2021, Oracle and/or its affiliates.

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;
±----±--------------±------------------------------------+
| seq | name | file |
±----±--------------±------------------------------------+
| 0 | main | |
| 2 | disk | /var/lib/proxysql/proxysql.db |
| 3 | stats | |
| 4 | monitor | |
| 5 | stats_history | /var/lib/proxysql/proxysql_stats.db |
±----±--------------±------------------------------------+

[root@li1038-93 ~]# proxysql-admin --enable

This script will assist with configuring ProxySQL for use with
Percona XtraDB Cluster (currently only PXC in combination
with ProxySQL is supported)

ProxySQL read/write configuration mode is singlewrite

ERROR 2003 (HY000): Can’t connect to MySQL server on ‘localhost:3306’ (111)
ERROR (line:588) : PXC connection check failed.
– Could not connect to the PXC cluster at localhost:3306
– Please check the PXC connection parameters and status.

1 Like

Follow-up. Attempted the following and a bit confused by the error. I assume the ‘monitor’ ID is required on the cluster side?

show grants for ‘admin’@‘45.56.115.5’;

GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE, CREATE ROLE, DROP ROLE ON . TO admin@45.56.115.5

[root@li1038-93 ~]# proxysql-admin --config-file=/etc/proxysql-admin.cnf --enable

This script will assist with configuring ProxySQL for use with
Percona XtraDB Cluster (currently only PXC in combination
with ProxySQL is supported)

ProxySQL read/write configuration mode is singlewrite

Configuring the ProxySQL monitoring user.

ProxySQL monitor user name as per command line/config-file is monitor
ERROR 1227 (42000) at line 1: Access denied; you need (at least one of) the CREATE USER privilege(s) for this operation
ERROR (line:1244) : Failed to create the ProxySQL monitoring user.
– Please check that ‘admin’@‘45.56.115.5’ has the proper permissions to create the montioring user

1 Like

Figured it out. it was a host-alias naming issue. Thanks.

1 Like