MySQL5.6启动时,按照下表,从上往下的顺序加载配置文件:

File Name Purpose
/etc/my.cnf Global options
/etc/mysql/my.cnf Global options
SYSCONFDIR/my.cnf Global options(CMake编译MySQL时,参数sysconfdir指定的值。缺省是安装后目录下)
$MYSQL_HOME/my.cnf

Server-specific options

包含my.cnf文件的环境变量。如果没有设置该环境变量,mysqld_safe会按照以下顺序尝试设置MYSQL_HOME的值:
·将BASEDIR和DATADIR分别设置为mysql的base目录和data目录
·如果my.cnf文件在DATADIR中,而不是在BASEDIR中,mysqld_safe会将MYSQL_HOME设置为DATADIR的值
·如果my.cnf文件在BASEDIR中,而不是在DATADIR中,mysqld_safe会将MYSQL_HOME设置为BASEDIR的值
MySQL5.6中,DATADIR不再作为my.cnf文件的存放位置

defaults-extra-file The file specified with --defaults-extra-file=file_name, if any
~/.my.cnf User-specific options
~/.mylogin.cnf Login path options

有多个配置文件的时候,后面的配置文件会覆盖前面的配置。如果没有配置文件,mysql启动的时候会按照编译时的默认参数设置启动实例。

MySQL加载配置文件的顺序的更多相关文章

  1. MySQL(window10)加载配置文件的顺序

    mysql加载配置的顺序为:(mysql --help中有详细的说明) C:\WINDOWS\my.ini C:\WINDOWS\my.cnf C:\my.ini C:\my.cnf D:***\my ...

  2. Linux下文件 ~/.bashrc 和 ~/.bash_profile 和 /etc/bashrc 和 /etc/profile 的区别 | 用户登录后加载配置文件的顺序

    转自 https://blog.csdn.net/secondjanuary/article/details/9206151 文件说明: /ect/profile 此文件为系统的每个用户设置环境信息, ...

  3. springboot(五) 加载配置文件优先级顺序

    github代码地址:https://github.com/showkawa/springBoot_2017/tree/master/spb-demo/spb-brian-query-service ...

  4. spring boot加载配置文件的顺序

    四个默认加载配置文件地方的优先级,四个文件相同配置有优先级概念  不同位置相互补充 外部配置文件不建议使用,不符合maven项目结构,打包会打不进去

  5. struts2框架加载配置文件的顺序

    struts-default.xml:该文件保存在struts2-core-x.x.x.jar文件中: struts-plugin.xml:该文件保存在 struts2-Xxx-x.x.x.jar等S ...

  6. 关于asp.net中页面事件加载的先后顺序

    一.ASP.NET 母版页和内容页中的事件 母版页和内容页都可以包含控件的事件处理程序.对于控件而言,事件是在本地处理的,即内容页中的控件在内容页中引发事件,母版页中的控件在母版页中引发事件.控件事件 ...

  7. powershell创建并加载配置文件

    $pshome :powershell的主目录 $profile :显示 Windows PowerShell 配置文件的路径 test-path $profile :确定是否已经在系统上创建了 Wi ...

  8. tomcat加载类的顺序

    /bin:存放启动和关闭tomcat的脚本文件: /conf:存放tomcat的各种配置文件,比如:server.xml /server/lib:存放tomcat服务器所需要的各种jar文件(jar文 ...

  9. mybatis 加载配置文件的方法

    一.  使用sqlSessionFactory 的 mapperLocations 进行加载 <!-- SessionFactory --> <bean id="sqlSe ...

随机推荐

  1. Invalid volume failure config value: 1

    原因: hdfs-site.xml中的配置为: <property> <name>dfs.datanode.failed.volumes.tolerated</name& ...

  2. Python+OpenCV实现FasterRcnn样本查看器

    一.上代码 import cv2 import os def get_samples(dir): datasets = [] files = os.listdir(dir) for file in f ...

  3. Java 图片验证码工具

    package com.microwisdom.utils; import java.awt.Color; import java.awt.Font; import java.awt.Graphics ...

  4. SpringMVC的页面几种返回方式

    package com.boventech.learning.controller; import java.util.HashMap; import java.util.Map; import or ...

  5. 最好使的歌词编辑工具--Beslyric

      https://www.cnblogs.com/BensonLaur/p/6262565.html 感谢开发这么好的工具! 下载地址:http://beslyric.320.io/BesBlog/ ...

  6. kettle的安装、配置与运行

      1.下载与安装 官方下载地址:https://community.hitachivantara.com/docs/DOC-1009855 下载好后,解压,还可以对该目录进行重命名. 2.环境配置 ...

  7. qtp descriptive programming multiple language(多语言支持)

    so easy, 1,use the descriptive programming; 2,use the | chracter to seperate the different language ...

  8. V-rep学习笔记:Geometric Constraint Solver(几何约束求解)

    The geometric constraint solver is slower and less precise at solving kinematic problems, but might ...

  9. SpringCloud学习资料

    CSDN博客:http://blog.csdn.net/k21325/article/details/52789829 http://blog.csdn.net/qq_26562641/article ...

  10. codevs 1862 最长公共子序列(求最长公共子序列长度并统计最长公共子序列的个数)

    题目描述 Description 字符序列的子序列是指从给定字符序列中随意地(不一定连续)去掉若干个字符(可能一个也不去掉)后所形成的字符序列.令给定的字符序列X=“x0,x1,…,xm-1”,序列Y ...