mysql(mariadb)之配置文件/etc/my.cnf的修改方式及查询当前值方式
MariaDB has many system variables that can be changed to suit your needs.
The full list of server variables are listed in the contents on this page, and most are described on this page, but some are described elsewhere:
MariaDB has many system variables that can be changed to suit your needs.
The full list of server variables are listed in the contents on this page, and most are described on this page, but some are described elsewhere:
See also the Full list of MariaDB options, system and status variables.
Most of these can be set with command line options and many of them can be changed at runtime.
There are a few ways to see the full list of server system variables:
While in the mysql client, run:
SHOW VARIABLES;
See SHOW VARIABLES for instructions on using this command.
From your shell, run mysqld like so:
mysqld --verbose --help
View the Information Schema GLOBAL_VARIABLES, SESSION_VARIABLES, and SYSTEM_VARIABLES tables.
Setting Server System Variables
There are several ways to set server system variables:
Specify them on the command line:
shell> ./mysqld_safe --aria_group_commit=“hard”
Specify them in your my.cnf file (see Configuring MariaDB with my.cnf for more information):
aria_group_commit = “hard”
Set them from the mysql client using the SET command. Only variables that are dynamic can be set at runtime in this way. Note that variables set in this way will not persist after a restart.
SET GLOBAL aria_group_commit=“hard”;
By convention, server variables have usually been specified with an underscore in the configuration files, and a dash on the command line. You can however specify underscores as dashes - they are interchangeable(强商科技:配置变量中的下划线与破折号是一样的效果).
Variables that take a numeric size can either be specified in full, or with a suffix for easier readability. Valid suffixes are:
Suffix
Description
Value
K
kilobytes
1024
M
megabytes
10242
G
gigabytes
10243
T
terabytes
10244 (from MariaDB 10.3.3)
P
petabytes
10245 (from MariaDB 10.3.3)
E
exabytes
10246 (from MariaDB 10.3.3)
The suffix can be upper or lower-case.