Differences between mysql status and variables

Source: Internet
Author: User

The difference between mysql status and variables: First, you can use the following two commands to view the corresponding mysql system parameter show status like '% abc %'; show variables like '% abc % '; however, many people do not understand the difference between the two. status indicates that the state of the system cannot be changed and is the current running state parameter of the system. The descriptions are as follows: java code: mysql> show status like 'innodb _ rows _ % '; + ---------------------- + --------- + | Variable_name | Value | + ---------------------- + --------- + | Innodb_rows_deleted | 0 | bytes | 1169098 | Innodb_rows_read | 7955216 | Innodb_rows_updated | 0 | + -------------------- + --------- + 4 rows in set (0.00 sec) Description: | Innodb_rows_deleted | 0 | number of rows deleted from the innodb table, 0 indicates that the data has not been deleted. | Innodb_rows_inserted | 1169098 | the number of rows inserted in the innodb table, it indicates that 1169098 rows are inserted. | Innodb_rows_read | 7955216 | number of rows obtained by executing select for the innodb table | Innodb_rows_updated | 0 | number of rows involved in performing update for the innodb table. The preceding four rows are innodb tables. running status parameters, it cannot be manually modified, but only the system can update it. The purpose is obviously to tell the dba the current system status, so that the dba can perform optimization. The above four records are reported. Assume that dba reads more than write at this time (I am executing insert into a select * from a, so the above data is generated), you can consider creating an appropriate index. If the read is 0, the write is very large, you can consider deleting indexes and so on. Java code mysql> show variables like 'query % '; + bytes + ---------- + | Variable_name | Value | + bytes + ---------- + | query_alloc_block_size | 8192 | query_cache_limit | 1048576 | bytes | 4096 | query_cache_size | 16777216 | query_cache_type | ON | | query_cache_wlock_invalidate | OFF | query_prealloc_size | 8192 | + ------------ ------------------ + ---------- + 7 rows in set (0.00 sec) The above mark is used to view the query cache information. At this time, you can optimize the cache configuration according to the status, it can be modified by setting or modifying the configuration file.

Related Article

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.