背景:mysqld同时指定了两个配置文件

mysqld --defaults-file=/myfolder/my.cnf --defaults-extra-file=/myfolder2/my.cnf

The /myfolder/my.cnf file has option set:

[mysqld]

skip-log-bin

/myfolder2/my.cnf has this option set:

[mysqld]

log-bin = /valid/path/to/mysqlbinlog

===============标准分割线=================

上干货

使用--defaults-file=FILE,mysql server仅从这个配置文件读取参数。(READ only the given option file.)

--defaults-extra-file=FILE的读取顺序在哪呢?在全局配置文件之后,用户配置文件之前。即不指定--default-file时,从以下文件顺序(第5个)读取配置文件。

测试了一下:

Bingo:

=========其他干货==========

mysqld读取的顺序:(第5个读取--defaults-extra-file=FILE指定的配置文件)

mysqld_safe的读取:(mysqld_safe调用mysqld,mysqld_multi也是同样,即mysqld也一样情况)

其他:

MySQL makes no guarantee about the order in which option files in the directory are read.

To work properly, each of these options must be given before other options.

When specifying file names as option values, avoid the use of the ~ shell metacharacter because it might not be interpreted as you expect.

拓展测试:

nohup /apps/svr/mysql57/bin/mysqld_safe --defaults-file=/apps/conf/mysql/mysql57_3306.cnf --skip-log-bin   --user=apps &

参考自:Mysql配置文件读取顺序 https://www.cnblogs.com/yangliheng/p/6475079.html

======End,=======

mysqld --defaults-file=/myfolder/my.cnf --defaults-extra-file=/myfolder2/my.cnf相关推荐

  1. internal server error怎么解决_MAC中MySQL添加my.cnf和PID file解决方案

    MAC版本:10.15 MySQL版本:8.0.21 secure_file_priv的取值决定是否可以导出或导入文件 添加my.cnf 导入导出文件会出现无法导入导出,因为secure_file_p ...

  2. Java File相关源码分析:File、FileInputStream、InputStreamReader

    该源码适用于windows环境下 最近做了个小系统,用到了File相关的类,如下: <span style="font-size:14px;">InputStreamR ...

  3. mysql my.cnf 不生效_MySQL修改my.cnf配置不生效的解决方法

    本文实例讲述了MySQL修改my.cnf配置不生效的解决方法.分享给大家供大家参考,具体如下: 一.问题: 修改了 my.cnf 配置文件后,却不生效,这是怎么回事? 二.原因: 我们注意到,这里只说 ...

  4. mysql 没有my.cnf文件_Linux mysql没有my.cnf,替代文件为mysql.conf.d

    ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) mysql数据root密码异常之 ...

  5. Cannot open precompiled header file:'Debug/password.pch' No such file or directory

    今天在VC6.0中咕哝个程序,遇到如下提示: Cannot open precompiled header file:'Debug/password.pch' No such file or dire ...

  6. cannot write file to virtual machine aborting the file copy operation.

    建立了一台虚拟机,把ORACLE 安装文件 拷贝到虚拟机中, 开始硬盘设置小了,空间不足.后来再增加一个磁盘,把对应文件拷贝到新的磁盘中. mount /opt   /dev/sdb1 mount / ...

  7. Cannot open precompiled header file: 'Debug/shuju1.pch': No such file or directory

    Q1: Cannot open precompiled header file: 'Debug/shuju1.pch': No such file or directory solution: 是预编 ...

  8. Solve error: Cannot open include file: 'X11/Xlocale.h': No such file or directory

    When you use FLTK with VS2010, you may get the error: fatal error C1083: Cannot open include file: ' ...

  9. Keil5 编译时显示..\OBJ\TPAD.axf: error: L6002U: Could not open file ..\obj\main.o: No such file or direct

    Keil5 编译时显示..\OBJ\TPAD.axf: error: L6002U: Could not open file ..\obj\main.o: No such file or direct ...

最新文章

  1. OutofMemory之PermGen介绍
  2. Android 微信支付步骤
  3. 爱与家庭,魔兽世界怀旧父亲为儿子打造精致音乐盒,满满的都是爱
  4. cshrc设置 ic618_.cshrc一般在什么地方
  5. 华为首款鸿蒙设备正式入网,华为首款鸿蒙设备正式入网:麒麟9000+挖孔全面屏,价格感人!...
  6. 盘点技术史:流量运营(PC 时代)
  7. windows删文件:找不到该项目,该项目不在xx中,请确认位置,然后重试 的解决方案
  8. Linux复习-进程及其管理
  9. 分享一下在用的私人小主机
  10. 学生成绩管理系统简单c语言源代码,c语言学生成绩管理系统源代码
  11. 如何成为优秀的程序员?
  12. 财务报表分析是在分析什么?如何选择财务报表分析工具
  13. “一对一直播源码开发”运筹帷幄之中,决胜千里之外
  14. python-DataFrame练习
  15. Java 拆分PDF文档
  16. 等保2.0正式发布了吗?核心思想包括什么?
  17. 同一个机器 安装多个版本Chrome浏览器的方法
  18. 店盈通:拼多多如何看到关键词进店?
  19. 低代码指南100解决方案:86教育信息化时代,学校该如何加强家校信息交流?
  20. 我爱大自然教案计算机,我爱大自然大班教案

热门文章

  1. 外贸在谷歌搜索客户,为什么搜索出来的都是同行?
  2. kafka(15) Kafka Connect
  3. 访谈 | 终于有人为了我解答了关于量化(交易)的种种疑惑
  4. 架构师之路---架构的演变详解
  5. 【Simulink】数字控制振荡器 NCO ( N umerically CONtrolled Oscillator )
  6. matlab做胶州湾地图,惊了,青岛也有了五环地图,快来看你家在几环?
  7. ubantu16.04下安装omnet5.4.1,inet3.6.4,veins4.7.1 和 sumo0.32.0
  8. 转行做开发要选择学习哪些软件技能
  9. 【威胁通告】攻击者利用漏洞攻击Edimax WiFi桥接器
  10. node.js毕业设计安卓电子阅读器APP(程序+APP+LW)