MySQL system variable Query

Source: Internet
Author: User

The MySQL system variables include global variables (globals) and session variables (sessions), the global variable takes effect for all session, and the session variable includes the global variable. MySQL tuning is bound to involve the adjustment of these system variables, so we first have to query the system variables.

1, query global variables: show global variables \g;

2. Query session variable: show session variables \g; or show variables;

As you can see, the variable table contains variable_name,value two fields, so you can filter the queries by these two fields.

3, query does not open the log configuration: show global variables where variable_name like '%log% ' and value= ' off ';

We can also query system variables using the Select field, with the following syntax

4, query Global log_bin variable: SELECT @ @global. log_bin;

5. Query Session variable: SELECT @ @session. [Field name]

6, the variable level is not clear, using the Select @@[field name query, the first query session variables, and then query global variables.

7. Query MySQL run statistics and status data: Show status. Similar to show variables, do not repeat.

MySQL system variable Query

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.