1、[server]和[MySQLd]的區(qū)別,沒有看到官方文檔,個人感覺server指整臺服務(wù)器,mysqld指實(shí)例,當(dāng)一臺服務(wù)器上多個實(shí)例使用同一個配置文件my.cnf時,[server]通用于所有實(shí)例,[mysqld_3306] [[mysqld_3307] [mysqld_3308]對應(yīng)單獨(dú)實(shí)例
綿陽網(wǎng)站制作公司哪家好,找創(chuàng)新互聯(lián)建站!從網(wǎng)頁設(shè)計(jì)、網(wǎng)站建設(shè)、微信開發(fā)、APP開發(fā)、成都響應(yīng)式網(wǎng)站建設(shè)公司等網(wǎng)站項(xiàng)目制作,到程序開發(fā),運(yùn)營維護(hù)。創(chuàng)新互聯(lián)建站自2013年創(chuàng)立以來到現(xiàn)在10年的時間,我們擁有了豐富的建站經(jīng)驗(yàn)和運(yùn)維經(jīng)驗(yàn),來保證我們的工作的順利進(jìn)行。專注于網(wǎng)站建設(shè)就選創(chuàng)新互聯(lián)建站。
2、mysqld從[mysqld]和[server]組中讀取選項(xiàng)。 mysqld_safe從[mysqld],[server],[mysqld_safe]和[safe_mysqld]組中讀取選項(xiàng)。 mysql.server從[mysqld]和[mysql.server]組中讀取選項(xiàng)。
3、[client]組更通用,因?yàn)樗凰锌蛻舳顺绦蜃x取,而[mysqldump]組只能由mysqldump讀取
4、后面的選項(xiàng)會覆蓋前面的選項(xiàng),比如按[client],[mysqldump]的順序放置選項(xiàng)組,則[mysqldump]選項(xiàng)會覆蓋[client]選項(xiàng)
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是要為其設(shè)置選項(xiàng)的程序或組的名稱。 在組行之后,任何選項(xiàng)設(shè)置行都將應(yīng)用于命名組,直到選項(xiàng)文件的末尾或另一個組行為止。 選項(xiàng)組名稱不區(qū)分大小寫。
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).
如果選項(xiàng)組名稱與程序名稱相同,則組中的選項(xiàng)將專門應(yīng)用于該程序。 例如,[mysqld]和[mysql]組分別應(yīng)用于mysqld服務(wù)器和mysql客戶端程序。
[client]選項(xiàng)組由MySQL發(fā)行版中提供的所有客戶端程序讀?。ǖ皇怯蒻ysqld提供)。
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]組使您可以指定適用于所有客戶端的選項(xiàng)。 例如,[client]是用于指定連接到服務(wù)器的密碼的適當(dāng)組。 (但請確保選項(xiàng)文件只能由您自己訪問,以便其他人無法發(fā)現(xiàn)您的密碼。)請確保不要在[client]組中添加選項(xiàng),除非您使用的所有客戶端程序都能識別它。 如果您嘗試運(yùn)行錯誤消息,則在顯示錯誤消息后,不理解該選項(xiàng)的程序?qū)⑼顺觥?/p>
首先列出更多通用選項(xiàng)組,稍后列出更具體的組。 例如,[client]組更通用,因?yàn)樗凰锌蛻舳顺绦蜃x取,而[mysqldump]組只能由mysqldump讀取。 稍后指定的選項(xiàng)會覆蓋先前指定的選項(xiàng),因此按[client],[mysqldump]的順序放置選項(xiàng)組會啟用特定于mysqldump的選項(xiàng)來覆蓋[client]選項(xiàng)。
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
要創(chuàng)建僅由特定MySQL發(fā)行系列中的mysqld服務(wù)器讀取的選項(xiàng)組,請使用名稱為[mysqld-5.6],[mysqld-5.7]等的組。 以下組表示sql_mode設(shè)置應(yīng)僅由具有5.7.x版本號的MySQL服務(wù)器使用:
[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.
像任何其他選項(xiàng)文件一樣寫入包含的選項(xiàng)文件的內(nèi)容。 也就是說,它應(yīng)該包含選項(xiàng)組,每個選項(xiàng)前面都有一個[group]行,表示選項(xiàng)適用的程序。
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]組中讀取選項(xiàng)。 mysqld_safe從[mysqld],[server],[mysqld_safe]和[safe_mysqld]組中讀取選項(xiàng)。 mysql.server從[mysqld]和[mysql.server]組中讀取選項(xiàng)。
嵌入式MySQL服務(wù)器通常從[server],[embedded]和[xxxxx_SERVER]組中讀取選項(xiàng),其中xxxxx是嵌入服務(wù)器的應(yīng)用程序的名稱。
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.
不僅要讀取常用選項(xiàng)組,還要讀取通常名稱和后綴str的組。 例如,mysqld通常讀取[mysqld]組。 如果給出了--defaults-group-suffix = _other選項(xiàng),mysqld也會讀取[mysqld_other]組。