zoukankan      html  css  js  c++  java
  • Mysql配置文件读取顺序

    On Unix, Linux and Mac OS X, MySQL programs read startup options from the following files, in the specified order (top items are used first).

    File Name Purpose
    /etc/my.cnf Global options
    /etc/mysql/my.cnf Global options
    SYSCONFDIR/my.cnf Global options
    $MYSQL_HOME/my.cnf Server-specific options
    defaults-extra-file The file specified with --defaults-extra-file=path, if any
    ~/.my.cnf User-specific options

    读取顺序为:
    /etc/my.cnf
    basedir/my.cnf
    datadir/my.cnf
    --defaults-extra-file #在读取全局配置文件之后,读取用户配置文件(~/.my.cnf)之前,读取extra指定的参数文件
    ~/.my.cnf #家目录下面的隐藏文件,my.cnf前面的点,说明my.cnf是隐藏文件

    假设4个配置文件都存在,同时使用--defaults-extra-file指定了参数文件,如果这时有一个 "参数变量"在5个配置文件中都出现了,那么后面的配置文件中的参数变量值 会 覆盖 前面配置文件中的参数变量值,就是说会使用~/.my.cnf中设置的值。

    注意

    如果使用./bin/mysqld_safe 守护进程启动mysql数据库时,使用了 --defaults-file=<配置文件的绝对路径>参数,这时只会使用这个参数指定的配置文件。

  • 相关阅读:
    前端工具Rythem介绍
    Redis持久化————AOF与RDB模式
    Hessian——轻量级远程调用方案
    JavaScript中的类数组对象
    在SpringMVC中获取request对象
    linux下,远程连接mysql
    nohup后台运行jar与关闭
    Vi常用命令
    spring mvc 重定向问题
    eclipse修改jdk后版本冲突问题
  • 原文地址:https://www.cnblogs.com/qiming0322/p/10143728.html
Copyright © 2011-2022 走看看