a)mysql> status information for the current database
II)mysql> Show status ( current session ) and show global status ( global ) View server state information
For example :
View temporary table : ShowGlobal status like ' created_tmp% ';
three ) mysql> show global variables look at the various status values that are running on the world server
For example :
Number of connections : Show variables like ' max_connections ';
MySQL pid file location : Show variables like ' Pid_file '
MySQL character set : show variables like '%character% ';
View data File storage location : showvariables like ' datadir ';
View memory Consumption (You also need to view Ps-aux|grep Mysql|awk ' {print $} ' at the system level )
Showvariables like ' innodb_buffer_pool_size ';
Showvariables like ' innodb_additional_mem_pool_size ';
Showvariables like ' innodb_log_buffer_size ';
Showvariables like ' thread_stack ';
four ) mysql> show Processlist shows which threads are running
five ) database Information_schema
The MySQL database is installed with the "INFORMATION_SCHEMA" information database. It holds information about all the other databases maintained by the MySQL server. such as database name, database table, table column data type and access rights limit, etc.
in information_schema, Check the space State and index status of the entire library:
Selectconcat (Truncate (SUM (data_length)/1024/1024,2), ' MB ') as Data_size,
Concat (Truncate (SUM (max_data_length)/1024/1024,2), ' MB ') as Max_data_size,
Concat (Truncate (SUM (data_free)/1024/1024,2), ' MB ') Asdata_free,
Concat (Truncate (SUM (index_length)/1024/1024,2), ' MB ') asindex_size
From information_schema.tables where table_schema = ' Database name ';
Chathan:
Selectconcat (Truncate (SUM (data_length)/1024/1024,2), ' MB ') as Data_size,
Concat (Truncate (SUM (max_data_length)/1024/1024,2), ' MB ') as Max_data_size,
Concat (Truncate (SUM (data_free)/1024/1024,2), ' MB ') Asdata_free,
Concat (Truncate (SUM (index_length)/1024/1024,2), ' MB ') asindex_size
From information_schema.tables WHERE table_name = ' Table name ';
This article is from the "Small Box" blog, please be sure to keep this source http://zhangxiaohe.blog.51cto.com/7821029/1545481
MySQL System Information query (incomplete, no typesetting)