1. View details of all current connections: Mysqladmin-uroot-proot processlist client use: Show full processlist2, view only the current number of connections (threads is the number of connections.): Mysqladmin-uroot-The proot status client uses:3. View the maximum number of connections show variables like"Max_connections";4: View current number of connections: Show global status like' Max_used_connections '; If the process prints out too much: MySQL-E ' show full processlist; ' > 111Workaround: SHOW GLOBAL VARIABLES like' Wait_timeout '; SHOW GLOBAL VARIABLES like' Interactive_timeout '; set global Wait_timeout=100; SET GLOBAL interactive_timeout=100; Modify the connection wait time to release the connection over time. The above is a real-time modification after restarting the database can be added in my.cnf wait_timeout=100Interactive_timeout=100looking again may find that the succession cannot be released. The database needs to be restarted. Shutdown mysqld may fail. Always............................................................................................. Restart the server. The "Bay stretched out" MySQL database is unresponsive. Can only be forced to restart the maximum number of connections (not recommended): MySQL server in the past the maximum number of connections is 245, did not reach the maximum number of server connections 256, there should be no 1040 error, the more ideal setting is: Max_used_connections/max_connections * 100%≈85%temporarily Modify set GLOBAL max_connections=1000; Permanent modification: Configuration/etc/My.cnf[mysqld] Add a new line with the following parameters: Max_connections=1000Show variables like' Max_connections ';
If not we view the maximum of 1000; This is due to the default number of open files limit for mariadb. Can be configured by/usr/lib/systemd/system/Mariadb.service to increase the number of open files. Configuration/usr/lib/systemd/system/Mariadb.service[service] Add two new lines to the following parameters: Limitnofile=10000Limitnproc=10000Reload the system service and restart the MARIADB service Systemctl--system daemon-Reload systemctl Restart Mariadb.service
Resolve MySQL database connection too much, most sleep