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