To check connected users in MySQL database and what operations are performed, we can use mysql cli or we can obtain same information through queries.
Check Connected Users in mysql cli
1 2 3 4 5 6 7 8 9 10 11 12 13 |
[root@mysqldb1 /]# mysql -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 73254 Server version: 5.6.31-ndb-7.4.12-cluster-gpl MySQL Cluster Community Server (GPL) Copyright (c) 2000, 2016, 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. |
1 2 3 4 5 6 7 8 |
mysql> show processlist; +-------+-------------+-----------+------+---------+------+-----------------------------------+------------------+ | Id | User | Host | db | Command | Time | State | Info | +-------+-------------+-----------+------+---------+------+-----------------------------------+------------------+ | 1 | system user | | | Daemon | 0 | Waiting for event from ndbcluster | NULL | | 73254 | root | localhost | mysql| Query | 0 | init | show processlist | +-------+-------------+-----------+------+---------+------+-----------------------------------+------------------+ 2 rows in set (0.00 sec) |