MySQL读取配置文件顺序

  1. 命令行
  2. defaults-file
  3. 配置文件
  4. 预编译
    # 默认读取配置文件顺序
    [root@clone2 ~]# mysql --help | grep my.cnf
    /etc/my.cnf
    /etc/mysql/my.cnf
    /usr/local/mysql/etc/my.cnf
    ~/.my.cnf

#以最后为准,后面的配置文件覆盖前面的配置

当命令行指定参数时,以命令行为准。

你可能感兴趣的:(MySQL读取配置文件顺序)