加入收藏 | 设为首页 | 会员中心 | 我要投稿 云计算网_泰州站长网 (http://www.0523zz.com/)- 视觉智能、AI应用、CDN、行业物联网、智能数字人!
当前位置: 首页 > 站长学院 > MySql教程 > 正文

my.cnf文件关于组选项的归纳

发布时间:2022-03-22 22:18:29 所属栏目:MySql教程 来源:互联网
导读:my.cnf文件关于组选项的总结: 1、[server]和[mysqld]的区别,没有看到官方文档,个人感觉server指整台服务器,mysqld指实例,当一台服务器上多个实例使用同一个配置文件my.cnf时,[server]通用于所有实例,[mysqld_3306] [[mysqld_3307] [mysqld_3308]对应
       my.cnf文件关于组选项的总结:

     1、[server]和[mysqld]的区别,没有看到官方文档,个人感觉server指整台服务器,mysqld指实例,当一台服务器上多个实例使用同一个配置文件my.cnf时,[server]通用于所有实例,[mysqld_3306] [[mysqld_3307] [mysqld_3308]对应单独实例
 
     2、mysqld从[mysqld]和[server]组中读取选项。 mysqld_safe从[mysqld],[server],[mysqld_safe]和[safe_mysqld]组中读取选项。 mysql.server从[mysqld]和[mysql.server]组中读取选项。
 
     3、[client]组更通用,因为它被所有客户端程序读取,而[mysqldump]组只能由mysqldump读取
 
     4、后面的选项会覆盖前面的选项,比如按[client],[mysqldump]的顺序放置选项组,则[mysqldump]选项会覆盖[client]选项
 
group是要为其设置选项的程序或组的名称。 在组行之后,任何选项设置行都将应用于命名组,直到选项文件的末尾或另一个组行为止。 选项组名称不区分大小写。
 
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).
 
如果选项组名称与程序名称相同,则组中的选项将专门应用于该程序。 例如,[mysqld]和[mysql]组分别应用于mysqld服务器和mysql客户端程序。
 
[client]选项组由MySQL发行版中提供的所有客户端程序读取(但不是由mysqld提供)。
 
首先列出更多通用选项组,稍后列出更具体的组。 例如,[client]组更通用,因为它被所有客户端程序读取,而[mysqldump]组只能由mysqldump读取。 稍后指定的选项会覆盖先前指定的选项,因此按[client],[mysqldump]的顺序放置选项组会启用特定于mysqldump的选项来覆盖[client]选项。
 
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
 
要创建仅由特定MySQL发行系列中的mysqld服务器读取的选项组,请使用名称为[mysqld-5.6],[mysqld-5.7]等的组。 以下组表示sql_mode设置应仅由具有5.7.x版本号的MySQL服务器使用:
 
[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.
 
像任何其他选项文件一样写入包含的选项文件的内容。 也就是说,它应该包含选项组,每个选项前面都有一个[group]行,表示选项适用的程序。
 
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.
 
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.
 
不仅要读取常用选项组,还要读取通常名称和后缀str的组。 例如,mysqld通常读取[mysqld]组。 如果给出了--defaults-group-suffix = _other选项,mysqld也会读取[mysqld_other]组。

(编辑:云计算网_泰州站长网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    热点阅读