1. View the detailed information of all current connections: ./mysqladmin -uadmin -p -h10.140.1.1 processlist2. View only the current number of connections (Threads is the number of connections): ./mysqladmin -uadmin -p -h10.140.1.1 status , View detailed information of all current connections: mysqladmin -uroot -proot processlist D:\MySQL\bin>mysqladmin -uroot -proot processlist| Id | User | Host | db | Command | Time | State | Info | | 591 | root | localhost:3544 | bbs | Sleep | 25 | | | | 701 | root | localhost:3761 | | uery | 0 | | show processlist | 2. Only view the current number of connections (Threads is the number of connections): mysqladmin -uroot -proot status D:\MySQL\bin>mysqladmin -uroot -proot status Uptime: 2102 Threads: 3 Questions: 15531 Slow queries: 0 Opens: 0 Flush tab les: 1 Open tables: 61 Queries per second avg: 7.3893, modify the maximum number of mysql connections: Open my.ini and modify max_connections=100 (the default is 100). Today, a MySQL server suddenly had a surge in connections, and all waiting processes were locked... Because of improper problem solving, I was scolded...OTL Summary: In the future, we should quickly locate errors and arrange solutions After logging in to the MySQL client, you can also use the status command to obtain the number of thread connections and the ID of the current connection. Or use Take a look at all the connection processes, pay attention to the process waiting time and whether the status is locked If there are too many processes, print out the processes and then check In addition, the method to modify the maximum number of MySQL connections: Edit MySQL (best combination with PHP) configuration file my.cnf or my.ini Add the following to the [MySQL (best combination with PHP)] configuration section: max_connections = 1000 Save and restart the MySQL (best combination with PHP) service. Then use the command: Where is the best place for abortion surgery in Wuxi? http://www.120csjlyy.com/ MySQL (best combination with PHP) After entering the password of the root database account, you can see | max_connections | 1000 | View the number of MySQL connections and the number of MySQL connections for the current user First enter the mysql prompt as an administrator. mysql> show processlist; can display the first 100 connection information, show full processlist; can display all. By the way, if you log in with a normal account, only this user's will be displayed. Note the semicolon after the command. If we want to view this server settings. This is the global limit on the number of connections. Summarize The above is a detailed explanation of how to view the current number of MySQL connections introduced by the editor. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website! You may also be interested in:
|
<<: When backing up files in Centos7, add the backup date to the backup file
>>: An article to understand operators in ECMAScript
1. Case Take all employees who are not the head o...
Crontab is a command used to set up periodic exec...
Preface Docker can configure environment variable...
Table of contents Overview What is Big O notation...
This article introduces the method of using CSS3 ...
Introduction to MQTT MQTT (Message Queuing Teleme...
CentOS 8 is now available! CentOS 8 and RedHat En...
Preface In order to follow the conventional WEB l...
WeChat applet trajectory playback mainly uses pol...
How to use the MySQL authorization command grant:...
Written in front In recent years, the live stream...
This article shares a sharing sidebar implemented...
Preface To solve the single point of failure, we ...
First, let's talk about why we use provide/in...
Table of contents 1. The magical extension operat...