How does MySql view the number of connections and status?

  • 2020-05-14 05:02:36
  • OfStack

How do I get to the mysql command line? There is an bin directory under the mysql installation directory, enter it from the command line, then log in using mysql-uroot-p123456 (note: user name and password do not include "")
Command: show processlist;
If you have an root account, you can see the current connections of all users. If it is a normal account, you can only see the connection you occupy.
show processlist; List only the first 100 items; if you want to list them all, use show full processlist;
mysql > show processlist;
Command: show status;
Command: show status like '% ';
Aborted_clients the number of connections that have been abandoned because the customer failed to close the connection properly has died.
The number of times Aborted_connects has tried to connect to an MySQL server that has failed.
The number of times Connections tried to connect to the MySQL server.
Created_tmp_tables the number of implied temporary tables that have been created when the statement is executed.
The number of deferred insert processor threads that Delayed_insert_threads is using.
The number of lines written by Delayed_writes with INSERT DELAYED.
The number of lines written by Delayed_errors with INSERT DELAYED that have some error (possibly repeating key values).
The number of times Flush_commands executed the FLUSH command.
The number of times Handler_delete requests a row to be deleted from a table.
The number of times Handler_read_first requests to read the first row of the table.
The Handler_read_key request number reads the line based on the key.
Handler_read_next requests the number of times a row based on a key is read.
Handler_read_rnd requests the number of times a row is read based on a fixed position.
The number of times Handler_update requests to update 1 row in the table.
The number of times Handler_write requests to insert a row into the table.
Key_blocks_used the number of blocks used for keyword caching.
The number of times Key_read_requests requests to read a key value from the cache.
The number of times Key_reads physically reads 1 key value from disk.
Key_write_requests requests the number of times a keyword block is written to the cache.
Key_writes the number of times a key value block is physically written to disk.
The maximum number of simultaneous connections used by Max_used_connections.
Not_flushed_key_blocks key blocks that have been changed in the key cache but have not been cleared to disk.
Not_flushed_delayed_rows the number of rows waiting to be written in the INSERT DELAY queue.
Number of open tables Open_tables.
Number of Open_files open files.
Number of open streams Open_streams (mainly for logging)
The number of tables that Opened_tables has opened.
Number of queries sent to the server by Questions.
The number of queries that Slow_queries spends more time than long_query_time.
Threads_connected the number of connections currently open.
Number of threads Threads_running not sleeping.
How many seconds did the Uptime server work?

Related articles: