MySQL System Information query (incomplete, no typesetting)

Source: Internet
Author: User

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)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.