mysql> select * from mysql_servers;
+--------------+--------------+------+--------+--------+-------------+-----------------+---------------------+---------+----------------+-----------+
| hostgroup_id | hostname | port | status | weight | compression | max_connections | max_replication_lag | use_ssl | max_latency_ms | comment |
+--------------+--------------+------+--------+--------+-------------+-----------------+---------------------+---------+----------------+-----------+
| 10 | 16.14.30.100 | 3306 | ONLINE | 1000 | 0 | 1000 | 0 | 0 | 0 | READWRITE |
+--------------------+--------------------------------------------------------------------------+-------------------------+
| username | password | default_hostgroup |
+--------------------+--------------------------------------------------------------------------+-------------------------+
| proxy_user | *341950EB3F9BD2343242342342425gfdb48B9A840C | 0 |
| proxysql_user | *2986g5E955C1FA5B2D9CC2FEF196AA46588A6AA0 | 10 |
| asterisk | *7BBBGGG85A37675Y46KJHKA24BC0BB10536AF1 | 10 |
+-------------------+---------------------------------------------------------------------------+------------------------+
3 rows in set (0.00 sec)
Now I will try 2 connections
1. Connect backend DB through ProxySQL with 'asterisk' user from Application machine.
2. Connection to DB from ProxySQL machine and check the status from processlist.
1.Output for connection from ProxySQL machine
[root@cybcallb ~]# mysql -u asterisk -p -h 16.14.30.105 -P 6033
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 387399
Server version: 5.5.30 (ProxySQL)
Copyright (c) 2009-2017 Percona LLC and/or its affiliates
Copyright (c) 2000, 2017, 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 |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| shems |
| sys |
| test |
+--------------------+
6 rows in set (0.00 sec)
mysql>
I also created the 'test' database with 'asterisk' user successfully and from output we can see full access to all databases.
(Note paste here about create database 'test' and done some insertion operation to table)
2. Just connection to ProxySQL machine from Application (Asterisk) with asterisk user
Now let's check the process list.
Login with monitor user in ProxySQL