Using the performance schema
Using the performance schema is similar to querying a table or set of tables.
Getting ready
Enable the performance schema as described in the Enabling the performance schema recipe earlier in this chapter.
How to do it...
Connect to MariaDB using the
mysql
command-line client. List how many current connections the users have and how many connections they had in total (we might want to log in and out a few times with example users to populate this table):SELECT * FROM performance_schema.users;
The preceding commands display an output similar to the following screenshot:
Look up for the detailed information on all of the currently running user connection threads:
SELECT * FROM performance_schema.threads WHERE type="foreground"\G
The preceding commands display an output similar to the following screenshot:
Add the following code to the
[mysqld]
section of ourmy.cnf
ormy.ini
file and then restart MariaDB to disable the collection of user connection statistics...