MySQL Server variables

Source: Internet
Author: User

Server variables for MySQL

The MySQL server maintains two major classes of variables, one server variable and the other state variable. which
Server variables: Define MySQL server run characteristics
1. mysql server variables can be divided into global variables and session variables according to scope:

Global variables:

#SHOW GLOBAL VARIABLES [like ' STRING '];

#使用该命令可以显示某个服务所有的全局变量及其值

Session Variables:

#SHOW [SESSION] VARIABLES [like ' STRING ']

#使用该命令可以显示所有的服务器会话变量及其值

2, MySQL server variable according to the effective time, it can be divided into dynamic variables and static variables:

Dynamic variables: Can be modified in time, permanently saved

Static variables: passed to the mysqld through the parameters, to be permanently effective, need to be modified to write in the configuration file.

Dynamic adjustment variables are effective in the following ways:

For global variables: invalid for current session, valid for new session

For session variables: effective in time, but only for current session

3. Display server variables and their values

mysql> SELECT @ @VARIABLE_NAME;

4. Setting server variables and their values

Mysql> SET {globallsession} variable_name= ' VALUE '


State variables:
MySQL Server run statistics saved
#SHOW GLOBAL STATUS [like ' STRING ']

This article is from the "Linux Learning path" blog, so be sure to keep this source http://xslwahaha.blog.51cto.com/4738972/1576300

MySQL Server variables

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.