1. To check the current value of max_connections, log into the MySQL server and type SHOW VARIABLES LIKE '%connections%'; on the MySQL command line.
MariaDB [(none)]> SHOW VARIABLES LIKE '%connections%';
+-----------------------+-------+
| Variable_name | Value |
+-----------------------+-------+
| extra_max_connections | 1 |
| max_connections | 151 |
| max_user_connections | 0 |
+-----------------------+-------+
2. To change the current value of max_connections, type SET GLOBAL max_connections = xxx; on the MySQL command line, where xxx=your desired value.
MariaDB [(none)]> SET GLOBAL max_connections = 250;
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> SHOW VARIABLES LIKE '%connections%';
+-----------------------+-------+
| Variable_name | Value |
+-----------------------+-------+
| extra_max_connections | 1 |
| max_connections | 250 |
| max_user_connections | 0 |
+-----------------------+-------+
Note: If you restart your VPS or MySQL server, you will lose these values.