(mysql.info.gz) Program variables
Info Catalog
(mysql.info.gz) Environment variable options
(mysql.info.gz) Program Options
4.3.4 Using Options to Set Program Variables
--------------------------------------------
Many MySQL programs have internal variables that can be set at runtime.
As of MySQL 4.0.2, program variables are set the same way as any other
long option that takes a value. For example, `mysql' has a
`max_allowed_packet' variable that controls the maximum size of its
communication buffer. To set the `max_allowed_packet' variable for
`mysql' to a value of 16MB, use either of the following commands:
shell> mysql --max_allowed_packet=16777216
shell> mysql --max_allowed_packet=16M
The first command specifies the value in bytes. The second specifies
the value in megabytes. Variable values can have a suffix of `K', `M',
or `G' (either uppercase or lowercase) to indicate units of kilobytes,
megabytes, or gigabytes.
In an option file, the variable setting is given without the leading
dashes:
[mysql]
max_allowed_packet=16777216
Or:
[mysql]
max_allowed_packet=16M
If you like, underscores in a variable name can be specified as dashes.
Prior to MySQL 4.0.2, program variable names are not recognized as
option names. Instead, use the `--set-variable' option to assign a
value to a variable:
shell> mysql --set-variable=max_allowed_packet=16777216
shell> mysql --set-variable=max_allowed_packet=16M
In an option file, omit the leading dashes:
[mysql]
set-variable = max_allowed_packet=16777216
Or:
[mysql]
set-variable = max_allowed_packet=16M
With `--set-variable', underscores in variable names cannot be given as
dashes for versions of MySQL older than 4.0.2.
The `--set-variable' option is still recognized in MySQL 4.0.2 and up,
but is deprecated.
Some server variables can be set at runtime. For details, see
Dynamic System Variables.
Info Catalog
(mysql.info.gz) Environment variable options
(mysql.info.gz) Program Options
automatically generated byinfo2html