Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Summary of group options in the my.cnf file

2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

1. The difference between [server] and [mysqld]. I do not see the official document. I feel that server refers to the whole server, and mysqld refers to the instance. When multiple instances on a server use the same configuration file my.cnf, [server] is common to all instances, and [mysqld_3306] [mysqld_3307] [mysqld_3308] corresponds to a single instance.

2. Mysqld reads options from [mysqld] and [server] groups. Mysqld_safe reads options from [mysqld], [server], [mysqld_safe] and [safe_mysqld] groups. Mysql.server reads options from the [mysqld] and [mysql.server] groups.

3. The [client] group is more generic because it is read by all client programs, while the [mysqldump] group can only be read by mysqldump.

4. The latter option overrides the previous option, such as placing option groups in the order of [client] and [mysqldump], then the [mysqldump] option overrides the [client] option.

Https://dev.mysql.com/doc/refman/5.7/en/option-files.html

[group]

Group is the name of the program or group for which you want to set options. After a group line, any option-setting lines apply to the named group until the end of the option file or another group line is given. Option group names are not case-sensitive.

Group is the name of the program or group for which you want to set options. After the group line, any option setting line is applied to the named group until the end of the options file or another group line. Option group names are not case sensitive.

If an option group name is the same as a program name, options in the group apply specifically to that program. For example, the [mysqld] and [mysql] groups apply to the mysqld server and the mysql client program, respectively.

The [client] option group is read by all client programs provided in MySQL distributions (but not by mysqld).

If the option group name is the same as the program name, the options in the group are specifically applied to the program. For example, the [mysqld] and [mysql] groups are applied to mysqld servers and mysql client programs, respectively.

The [client] option group is read by all client programs provided in the MySQL distribution (but not by mysqld).

The [client] group enables you to specify options that apply to all clients. For example, [client] is the appropriate group to use to specify the password for connecting to the server. But make sure that the option file is accessible only by yourself, so that other people cannot discover your password. Be sure not to put an option in the [client] group unless it is recognized by all client programs that you use. Programs that do not understand the option quit after displaying an error message if you try to run them.

List more general option groups first and more specific groups later. For example, a [client] group is more general because it is read by all client programs, whereas a [mysqldump] group is read only by mysqldump. Options specified later override options specified earlier, so putting the option groups in the order [client], [mysqldump] enables mysqldump-specific options to override [client] options.

The [client] group allows you to specify options that apply to all clients. For example, [client] is the appropriate group to specify the password to connect to the server. (however, make sure that the options file can only be accessed by yourself, so that others cannot discover your password. ) be sure not to add an option to the [client] group unless it is recognized by all client programs you use. If you try to run an error message, a program that does not understand this option will exit after the error message is displayed.

List more common option groups first, and more specific groups later. For example, the [client] group is more generic because it is read by all client programs, while the [mysqldump] group can only be read by mysqldump. The options specified later override the previously specified options, so placing option groups in the order of [client], [mysqldump] enables mysqldump-specific options to override the [client] option.

To create option groups to be read only by mysqld servers from specific MySQL release series, use groups with names of [mysqld-5.6], [mysqld-5.7], and so forth. The following group indicates that the sql_mode setting should be used only by MySQL servers with 5.7.x version numbers:

[mysqld-5.7]

Sql_mode=TRADITIONAL

To create an option group that is read only by mysqld servers in a specific MySQL release series, use a group named [mysqld-5.6], [mysqld-5.7], and so on. The following groups indicate that the sql_mode setting should be used only by MySQL servers with 5.7.x version numbers:

[mysqld-5.7]

Sql_mode=TRADITIONAL

Write the contents of an included option file like any other option file. That is, it should contain groups of options, each preceded by a [group] line that indicates the program to which the options apply.

Write the contents of the included options file like any other option file. That is, it should contain a group of options, each preceded by a [group] line indicating the program to which the option applies.

Https://dev.mysql.com/doc/refman/5.7/en/server-options.html

Mysqld reads options from the [mysqld] and [server] groups. Mysqld_safe reads options from the [mysqld], [server], [mysqld_safe], and [safe_mysqld] groups. Mysql.server reads options from the [mysqld] and [mysql.server] groups.

An embedded MySQL server usually reads options from the [server], [embedded], and [xxxxx_SERVER] groups, where xxxxx is the name of the application into which the server is embedded.

Mysqld reads options from the [mysqld] and [server] groups. Mysqld_safe reads options from [mysqld], [server], [mysqld_safe] and [safe_mysqld] groups. Mysql.server reads options from the [mysqld] and [mysql.server] groups.

Embedded MySQL servers typically read options from [server], [embedded], and [xxxxx_SERVER] groups, where xxxxx is the name of the application embedded in the server.

Https://dev.mysql.com/doc/refman/5.7/en/server-options.html#option_mysqld_defaults-group-suffix

Read not only the usual option groups, but also groups with the usual names and a suffix of str. For example, mysqld normally reads the [mysqld] group. If the-defaults-group-suffix=_other option is given, mysqld also reads the [mysqld_other] group.

Read not only the common option groups, but also the groups with the usual name and suffix str. For example, mysqld usually reads the [mysqld] group. If the-- defaults-group-suffix = _ other option is given, mysqld also reads the [mysqld_other] group.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report