您好,登錄后才能下訂單哦!
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]選項
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是要為其設置選項的程序或組的名稱。 在組行之后,任何選項設置行都將應用于命名組,直到選項文件的末尾或另一個組行為止。 選項組名稱不區分大小寫。
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提供)。
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.
[client]組使您可以指定適用于所有客戶端的選項。 例如,[client]是用于指定連接到服務器的密碼的適當組。 (但請確保選項文件只能由您自己訪問,以便其他人無法發現您的密碼。)請確保不要在[client]組中添加選項,除非您使用的所有客戶端程序都能識別它。 如果您嘗試運行錯誤消息,則在顯示錯誤消息后,不理解該選項的程序將退出。
首先列出更多通用選項組,稍后列出更具體的組。 例如,[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.
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從[mysqld]和[server]組中讀取選項。 mysqld_safe從[mysqld],[server],[mysqld_safe]和[safe_mysqld]組中讀取選項。 mysql.server從[mysqld]和[mysql.server]組中讀取選項。
嵌入式MySQL服務器通常從[server],[embedded]和[xxxxx_SERVER]組中讀取選項,其中xxxxx是嵌入服務器的應用程序的名稱。
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.
不僅要讀取常用選項組,還要讀取通常名稱和后綴str的組。 例如,mysqld通常讀取[mysqld]組。 如果給出了--defaults-group-suffix = _other選項,mysqld也會讀取[mysqld_other]組。
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。