How many connections can be opened concurrently against my MySQL or MariaDB database can be checked with the following command, this command should enter in mysql:
SHOW GLOBAL VARIABLES LIKE 'max_connections';
+-----------------+-------+
| Variable_name | Value |
+-----------------+-------+
| max_connections | 505 |
+-----------------+-------+
If this limit was ever reached in the past can be checked with:
SHOW GLOBAL STATUS LIKE 'max_use%';
+----------------------+-------+
| Variable_name | Value |
+----------------------+-------+
| Max_used_connections | 23 |
+----------------------+-------+
We can configure how many connections one specific user can have at maximum at the same time with:
SHOW GLOBAL VARIABLES LIKE 'max_user_connections';
+----------------------+-------+
| Variable_name | Value |
+----------------------+-------+
| max_user_connections | 500 |
+----------------------+-------+
Further we can limit one specific user with:
GRANT USAGE ON *.* TO 'DBuser_here'@'%' WITH MAX_CONNECTIONS_PER_HOUR 100 MAX_USER_CONNECTIONS 10;
and check with :
SELECT User, Host, max_connections, max_user_connections FROM mysql.user;