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=<配置文件的绝对路径>参数,这时只会使用这个参数指定的配置文件。

  • 相关阅读:
    算法
    用python代码编写象棋界面,棋盘覆盖问题
    深浅拷贝的原理
    MongoDB简介,安装,增删改查
    DBUtils-Python数据库连接池
    websocket
    Python操作 RabbitMQ、Redis、Memcache、SQLAlchemy
    跨域
    最长公共子序列/子串 LCS(模板)
    寒假作业---蓝桥杯---DFS
  • 原文地址:https://www.cnblogs.com/qiming0322/p/10143728.html
Copyright © 2011-2022 走看看