# when work with latest edition of proxySQL

**URL:** https://forums.percona.com/t/when-work-with-latest-edition-of-proxysql/7848
**Category:** Percona XtraDB Cluster 8.x
**Created:** [August 5, 2020, 9:14am UTC](https://forums.percona.com/t/when-work-with-latest-edition-of-proxysql/7848 "2020-08-05T09:14:42Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![DBA100](https://avatars.discourse-cdn.com/v4/letter/d/b3f665/32.png) [@DBA100](https://forums.percona.com/u/DBA100)
#### Post date: [August 5, 2020, 9:14am UTC](https://forums.percona.com/t/when-work-with-latest-edition-of-proxysql/7848/1 "2020-08-05T09:14:42Z")

</div>

hi,  
  
I follow the Percona xtraDB cluster installation menu to setup ProxySQL , but when I connect from workbench using an account to login to the proxySQL and I expect&nbsp; I can select the backend MySQL data.&nbsp; It is not !  
the menu I follow is “LOAD BALANCING WITH PROXYSQL” section in “Percona XtraDB Cluster Documentation, Release 8.0.19-10”.  
  
What I have done is:  
  
1) I have install ProxySQL:  
&nbsp;&nbsp;Percona-XtraDB-Cluster-client-80.xxxx rpm  
&nbsp;proxysql2.xxxx rpm  
  
once installed this commands is ok:  
“mysql -u admin -padmin -h 127.0.0.1 -P 6032”  
and "mysql -u admin -padmin -h 127.0.0.1 -P6032 --prompt=‘Admin\> ’ " .  
2) I can do&nbsp;mysql@proxysql\> SHOW DATABASES;  
mysql@proxysql\> SHOW TABLES;  
3) I can add nodes to the proxysQL:  
mysql@proxysql\> INSERT INTO mysql\_servers(hostgroup\_id, hostname, port) VALUES (0,˓→’192.168.70.61’,3306);mysql@proxysql\> INSERT INTO mysql\_servers(hostgroup\_id, hostname, port) VALUES (0,˓→’192.168.70.62’,3306);mysql@proxysql\> INSERT INTO mysql\_servers(hostgroup\_id, hostname, port) VALUES (0,˓→’192.168.70.63’,3306);  
  
and I do select \* from mysql\_Servers, it shown out what I inserted,  
  
4)I create proxysql user and add to ono of the percona db nodes as the proxySQL to DB monitoring account.

mysql@pxc2\> CREATE USER  
‘proxysql’@‘%’ IDENTIFIED WITH mysql\_native\_password by ‘\<password\>’;

mysql@pxc2\> GRANT USAGE ON \*.\* TO 'proxysql'@'%';

5)&nbsp;configure this user on the ProxySQL node:

mysql@proxysql\> UPDATE global\_variables SET variable\_value='proxysql'

WHERE variable\_name='mysql-monitor\_username';

mysql@proxysql\> UPDATE global\_variables SET variable\_value='\<password\>'

WHERE variable\_name='mysql-monitor\_password';

6)&nbsp;

mysql@proxysql\> LOAD MYSQL VARIABLES TO RUNTIME;

mysql@proxysql\> SAVE MYSQL VARIABLES TO DISK;

7) however when doing this to ensure that monitoring is enabled,:

mysql@proxysql\> SELECT \* FROM monitor.mysql\_server\_connect\_log ORDER BY time\_start\_us

˓→DESC LIMIT 6;

it say monitor.mysql\_server\_connect\_log doesn't exists ! why ?

7) to enabled mnnitorings of these nodes, load them at runtime:

mysql@proxysql\> LOAD MYSQL SERVERS TO RUNTIME;

8)&nbsp;Creating ProxySQL Monitoring User

mysql@pxc2\> CREATE USER 'proxysql'@'%' IDENTIFIED WITH mysql\_native\_password by '$3Kr

˓→$t';

mysql@pxc2\> GRANT USAGE ON \*.\* TO 'proxysql'@'%';

9)&nbsp;Creating ProxySQL Client User

is this one create in proxySQL level or database level? which user account has to be create on both proxySQL side and DB size?&nbsp;

is this one user connect to DB back bone via proxySQL ?

so this one must both in proxysql and DB level ? both must use the SAME password?

Is this one the application account application use to connect to DB via proxy ?

question:

1) once I connect using client user, it will be timeout message when connect to the proxySQL!

and what is the mapping so that proxySQL know which account used to connect to backed DB ? it is not the monitor account which we have to create in dB side, right?

2) what is missing in the above steps ?

---

<div class="post-metadata">

### Author: ![Guru](https://avatars.discourse-cdn.com/v4/letter/g/ecae2f/32.png) [@Guru](https://forums.percona.com/u/Guru)
#### Post date: [August 7, 2020, 3:26am UTC](https://forums.percona.com/t/when-work-with-latest-edition-of-proxysql/7848/2 "2020-08-07T03:26:47Z")

</div>

you must have on ProxySQL all the same User like in DB with the same Passwords

---

<div class="post-metadata">

### Author: ![DBA100](https://avatars.discourse-cdn.com/v4/letter/d/b3f665/32.png) [@DBA100](https://forums.percona.com/u/DBA100)
#### Post date: [August 7, 2020, 3:57am UTC](https://forums.percona.com/t/when-work-with-latest-edition-of-proxysql/7848/3 "2020-08-07T03:57:42Z")

</div>

wait, this mean in proxySQL I have to create the same user in Percona DB as well and their passwrod the same ?

---

<div class="post-metadata">

### Author: ![Guru](https://avatars.discourse-cdn.com/v4/letter/g/ecae2f/32.png) [@Guru](https://forums.percona.com/u/Guru)
#### Post date: [August 7, 2020, 8:21am UTC](https://forums.percona.com/t/when-work-with-latest-edition-of-proxysql/7848/4 "2020-08-07T08:21:18Z")

</div>

Yes!But you dont neet to use the same Password in plain text, you kann take the hash from user table.

---

<div class="post-metadata">

### Author: ![DBA100](https://avatars.discourse-cdn.com/v4/letter/d/b3f665/32.png) [@DBA100](https://forums.percona.com/u/DBA100)
#### Post date: [August 7, 2020, 8:26am UTC](https://forums.percona.com/t/when-work-with-latest-edition-of-proxysql/7848/5 "2020-08-07T08:26:36Z")

</div>

“But you dont neet to use the same Password in plain text,”  
  
both password save in the database right? I am not sure what you mean plain text&nbsp; ! as long as the same user with same password, user connected to the proxySQL will AUTOMATICALLY route to the backend percona cluster node?  
  
how about the user account permission of that user account? must be the same again ?

---

<div class="post-metadata">

### Author: ![Guru](https://avatars.discourse-cdn.com/v4/letter/g/ecae2f/32.png) [@Guru](https://forums.percona.com/u/Guru)
#### Post date: [August 7, 2020, 9:45am UTC](https://forums.percona.com/t/when-work-with-latest-edition-of-proxysql/7848/6 "2020-08-07T09:45:21Z")

</div>

> DBA100 said: "But you dont neet to use the same Password in plain text,"  
>   
> both password save in the database right? I am not sure what you mean plain text&nbsp; ! as long as the same user with same   
> password, user connected to the proxySQL will AUTOMATICALLY route to the backend percona cluster node?  
>   
> how about the user account permission of that user account? must be the same again ?

for example:  
plain text password:&nbsp; geheimhash in user table: \*EC575F87BA2EC345EAE587C23C33B0353D4DBA59You are free to use in ProxySQL one of them.I recommend using the hash, then you can simplify the synchronization of the users between the DB and the ProxySQL with a script.  
Yes, ProxySQL will automatically route to the DB.

---

<div class="post-metadata">

### Author: ![Guru](https://avatars.discourse-cdn.com/v4/letter/g/ecae2f/32.png) [@Guru](https://forums.percona.com/u/Guru)
#### Post date: [August 7, 2020, 9:50am UTC](https://forums.percona.com/t/when-work-with-latest-edition-of-proxysql/7848/7 "2020-08-07T09:50:03Z")

</div>

please read this:[http://blog.muhrizal.com/2017/12/13/Configure-ProxySQL-on-Ubuntu-16-04/](http://blog.muhrizal.com/2017/12/13/Configure-ProxySQL-on-Ubuntu-16-04/)   
[https://www.digitalocean.com/community/tutorials/how-to-use-proxysql-as-a-load-balancer-for-mysql-on-ubuntu-16-04](https://www.digitalocean.com/community/tutorials/how-to-use-proxysql-as-a-load-balancer-for-mysql-on-ubuntu-16-04 "Link: https://www.digitalocean.com/community/tutorials/how-to-use-proxysql-as-a-load-balancer-for-mysql-on-ubuntu-16-04")

---

<div class="post-metadata">

### Author: ![DBA100](https://avatars.discourse-cdn.com/v4/letter/d/b3f665/32.png) [@DBA100](https://forums.percona.com/u/DBA100)
#### Post date: [August 8, 2020, 6:22am UTC](https://forums.percona.com/t/when-work-with-latest-edition-of-proxysql/7848/8 "2020-08-08T06:22:12Z")

</div>

let me check and come back later if I need.

---

<div class="post-metadata">

### Author: ![DBA100](https://avatars.discourse-cdn.com/v4/letter/d/b3f665/32.png) [@DBA100](https://forums.percona.com/u/DBA100)
#### Post date: [August 24, 2020, 1:06am UTC](https://forums.percona.com/t/when-work-with-latest-edition-of-proxysql/7848/9 "2020-08-24T01:06:10Z")

</div>

when I follow this to setup ProxySQL V2:  
  
[http://blog.muhrizal.com/2017/12/13/Configure-ProxySQL-on-Ubuntu-16-04/](http://blog.muhrizal.com/2017/12/13/Configure-ProxySQL-on-Ubuntu-16-04/)&nbsp;  
  
in this steps:  
  
Add a monitoring user on ProxySQL:

| 

```auto
1<br>2

```

 | ``` mysql\> CREATE USER 'proxysql'@'%' IDENTIFIED BY 'ProxySQLPassword';  
mysql\> GRANT USAGE ON \*.\* TO 'proxysql'@'%'; ``` |

  
it seems proxysQL admin console do not allow me to do this and it say:  
  
ERROR 1045 (28000): ProxySQL Admin Error: near "USER": syntax error.  
  
when you login to the ProxySQL admin console by this:  
  
``` mysql -u admin -padmin -h 127.0.0.1 -P6032 --prompt='Admin\> ' ```  
the prompt is always:  
Admin\>  
  
instead of  
  
MySQL\>  
  
is it a mistake ? that's why I can't use this command to create a user in ProxySQL;  
  
``` CREATE USER 'proxysql'@'%' IDENTIFIED BY 'ProxySQLPassword'; ``` ?  
or actually I need this to add a proxySQL users?  
  
INSERT INTO mysql\_users (username,password) VALUES (' \<name\> ',' \<password');  
?

---

<div class="post-metadata">

### Author: ![DBA100](https://avatars.discourse-cdn.com/v4/letter/d/b3f665/32.png) [@DBA100](https://forums.percona.com/u/DBA100)
#### Post date: [August 24, 2020, 9:14am UTC](https://forums.percona.com/t/when-work-with-latest-edition-of-proxysql/7848/10 "2020-08-24T09:14:47Z")

</div>

I checked and it seems that manual is wrong and we should follow the offical proxySQL guide:  
  
[https://proxysql.com/documentation/ProxySQL-Configuration/](https://proxysql.com/documentation/ProxySQL-Configuration/ "Link: https://proxysql.com/documentation/ProxySQL-Configuration/")&nbsp;  
  
and I found sth wong in other page, it said:  
  
Admin\>&nbsp;INSERT&nbsp;INTO&nbsp;mysql\_servers(hostgroup\_id,hostname,port)&nbsp;VALUES&nbsp;(1,‘127.0.0.1’,21891);  
Query&nbsp;OK,&nbsp;1&nbsp;row&nbsp;affected&nbsp;(0.01&nbsp;sec)  
&nbsp;  
Admin\>&nbsp;INSERT&nbsp;INTO&nbsp;mysql\_servers(hostgroup\_id,hostname,port)&nbsp;VALUES&nbsp;(1,‘127.0.0.1’,21892);  
Query&nbsp;OK,&nbsp;1&nbsp;row&nbsp;affected&nbsp;(0.01&nbsp;sec)  
&nbsp;  
Admin\>&nbsp;INSERT&nbsp;INTO&nbsp;mysql\_servers(hostgroup\_id,hostname,port)&nbsp;VALUES&nbsp;(1,‘127.0.0.1’,21893);  
Query&nbsp;OK,&nbsp;1&nbsp;row&nbsp;affected&nbsp;(0.00&nbsp;sec)  
&nbsp;  
  
but in section;  
  
Admin\> SHOW CREATE TABLE mysql\_replication\_hostgroups\G

```auto
&nbsp; &nbsp; &nbsp; &nbsp;table: mysql_replication_hostgroups<br>Create&nbsp;Table:&nbsp;CREATE&nbsp;TABLE&nbsp;mysql_replication_hostgroups&nbsp;(<br>writer_hostgroup&nbsp;INT&nbsp;CHECK&nbsp;(writer_hostgroup&gt;=0)&nbsp;NOT&nbsp;NULL&nbsp;PRIMARY&nbsp;KEY,<br>reader_hostgroup&nbsp;INT&nbsp;NOT&nbsp;NULL&nbsp;CHECK&nbsp;(reader_hostgroup&lt;&gt;writer_hostgroup&nbsp;AND&nbsp;reader_hostgroup&gt;0),<br>comment&nbsp;VARCHAR,<br>UNIQUE&nbsp;(reader_hostgroup))<br>1&nbsp;row&nbsp;in&nbsp;set&nbsp;(0.00&nbsp;sec)<br>&nbsp;<br>Admin&gt;&nbsp;INSERT&nbsp;INTO&nbsp;mysql_replication_hostgroups&nbsp;VALUES&nbsp;(1,2,'cluster1');<br>Query OK, 1 row affected (0.00 sec)

```

but on my end the SHOW CREATE TABLE mysql\_replication\_hostgroups\G &nbsp;shows:  
  
[![](https://us1.discourse-cdn.com/flex019/uploads/percona1/original/2X/a/a6c1fef6391f7745020db072cc9b02e0918ed26c.png)](https://filedb.experts-exchange.com/incoming/2020/08_w35/1495957/1598280060300.png)  
check my output (the schema) is not the same so when I do:

```auto
INSERT INTO mysql_replication_hostgroups VALUES (1,2,'cluster1'); 

```

it shown:  
[![](https://us1.discourse-cdn.com/flex019/uploads/percona1/original/2X/2/264cf83d872226539db5a8b81806e7f61f182128.png "Image: https://filedb.experts-exchange.com/incoming/2020/08\_w35/1495960/1598280190600.png")](https://filedb.experts-exchange.com/incoming/2020/08_w35/1495960/1598280190600.png)  
&nbsp;as the schema is not the same! what should I input?
