MySQL variables:
Server variables:
Use parameters to change the MySQL run feature. The directive that is defined in the configuration file.
To view server variables:
mysql>show [GLOBAL] [SESSION] VARIABLES [like ' STRING '];
mysql> SELECT @@ global| [SESSION] STRING;
To modify a service variable:
Mysql>set global| SESSION string= ' VALUE ';
by Scope:
Global variables:
The variable has been in effect since the server started. No user settings are required.
Only users with full permissions can modify global variables.
Mysql>>show GLOBAL VARIABLES [like ' STRING '];
Session Variables:
Valid only for the current session and expire after the session is terminated.
Normal users can modify session variables.
Mysql>show [SESSION] VARIABLES [like ' STRING '];
According to the effective time division:
Dynamic adjustment:
It can be modified immediately and will take effect as soon as it is modified.
Global variables:
Invalid for the current session, only valid for newly established sessions.
Session Variables:
Takes effect immediately, but only valid for the current session.
Static adjustment:
The service needs to be restarted after the adjustment.
Can be written in a configuration file or passed to mysqld or mysqld-safe by parameters.
This article is from "Small Private blog" blog, please be sure to keep this source http://ggvylf.blog.51cto.com/784661/1679328
The MySQL variable