From time to time, I'm getting an error "mysqli_connect(): (HY000/1203): User already has more than 'max_user_connections' active connections.
" I checked the MySQL max_connection variable, and it's at 150. What's odd is that when I check for Max_used_connections, it says 41, which (I think) implies that MySql never reached 150 simultaneous connections. The per-user Max_user_connections variable is 0, so it should effectively be the same as max_connections. Am I misunderstanding what these variables mean, or is something odd going on with MySql?
I use PHP to connect to MySql. The MySql version is 5.7.40
Here are the results of show status like '%connec%';
and show variables like '%connections%';
| Variable_name | Value |
+-----------------------------------------------+---------------------+
| Aborted_connects | 776 |
| Connection_errors_accept | 0 |
| Connection_errors_internal | 0 |
| Connection_errors_max_connections | 0 |
| Connection_errors_peer_address | 0 |
| Connection_errors_select | 0 |
| Connection_errors_tcpwrap | 0 |
| Connections | 8899838 |
| Locked_connects | 0 |
| Max_used_connections | 41 |
| Max_used_connections_time | 2022-10-25 13:57:07 |
| Performance_schema_session_connect_attrs_lost | 0 |
| Ssl_client_connects | 0 |
| Ssl_connect_renegotiates | 0 |
| Ssl_finished_connects | 0 |
| Threads_connected | 1 |
+-----------------------------------------------+---------------------+
+----------------------+------------+
| Variable_name | Value |
+----------------------+------------+
| max_connections | 150 |
| max_user_connections | 2147483647 |
+----------------------+------------+
Also, I doubt I'm using up all connections by serving web pages; I'm not doing complicated queries, and the data sets are relatively small. Can someone point me to how to find what process/user maxes out these resources?