This article is the Official Handbook of MARIADB: Set translations.
Original:https://mariadb.com/kb/en/set/
I submit it to MARIADB official manual:https://mariadb.com/kb/zh-cn/set/
Grammar
SET variable_assignment [, variable_assignment] ...variable_assignment: user_var_name = expr | [GLOBAL | SESSION] system_var_name = expr | [@@global. | @@session. | @@]system_var_name = expr
User variables can be set in any expression using the following syntax:
user_var_name:= expr
Describe
SET
Statements can be assigned to different variable types that affect the service side or client. The old version of MySQL was used, but was deprecated with syntax and was SET OPTION
OPTION
SET
removed in version 10.0 of MARIADB.
To assign a value to a variable based on each query (Per-query) (function starting after mariadb 10.1.2), see SET STATEMENT.
To view server-side system variables, see SHOW VARIABLES.
The Server system Variables lists all of the system variables.
Example
SHOW VARIABLES WHERE variable_name like "aria_group_commit%";+----------------------------+-------+| variable_name | Value |+----------------------------+-------+| Aria_group_commit | none | | Aria_group_commit_interval | 0 |+----------------------------+-------+ SET GLOBAL aria_group_commit="hard"; SET GLOBAL aria_group_commit_interval=; SHOW VARIABLES WHERE variable_name like "aria_group_commit%";+----------------------------+-------+| variable_name | Value |+----------------------------+-------+| Aria_group_commit | Hard | | Aria_group_commit_interval | 100 |+----------------------------+-------+
Direct assignment:
SELECT (@a:=1);+---------+| (@a:=1) |+---------+| 1 |+---------+SELECT @a;+------+| @a |+------+| 1 |+------+
Back to Linux series article outline: http://www.cnblogs.com/f-ck-need-u/p/7048359.html
Back to Site Architecture series article outline: http://www.cnblogs.com/f-ck-need-u/p/7576137.html
Back to Database series article outline: http://www.cnblogs.com/f-ck-need-u/p/7586194.html
Reprint Please specify source: http://www.cnblogs.com/f-ck-need-u/p/8616226.html
Note: If you think this article is not bad please click on the lower right corner of the recommendation, your support can inspire the author more enthusiasm for writing, thank you very much!
Translation: SET clause (submitted to MARIADB official manual)