# Proxysql config initialization

**URL:** <https://forums.percona.com/t/proxysql-config-initialization/10963>\
**Category:** Percona XtraDB Cluster 8.x\
**Created:** [June 21, 2021, 5:38pm UTC](https://forums.percona.com/t/proxysql-config-initialization/10963 "2021-06-21T17:38:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mikem](https://avatars.discourse-cdn.com/v4/letter/m/41988e/32.png) [@Mikem](https://forums.percona.com/u/Mikem)\
**Post date:** [June 21, 2021, 5:38pm UTC](https://forums.percona.com/t/proxysql-config-initialization/10963/1 "2021-06-21T17:38:25Z")

</div>

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](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.

---

<div class="post-metadata">

**Author:** ![Mikem](https://avatars.discourse-cdn.com/v4/letter/m/41988e/32.png) [@Mikem](https://forums.percona.com/u/Mikem)\
**Post date:** [June 21, 2021, 6:24pm UTC](https://forums.percona.com/t/proxysql-config-initialization/10963/2 "2021-06-21T18:24:24Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Mikem](https://avatars.discourse-cdn.com/v4/letter/m/41988e/32.png) [@Mikem](https://forums.percona.com/u/Mikem)\
**Post date:** [June 21, 2021, 6:55pm UTC](https://forums.percona.com/t/proxysql-config-initialization/10963/3 "2021-06-21T18:55:21Z")

</div>

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