• mysql在linux下查看my.cnf位置的方法


    安装mysql后,系统中会有多个my.cnf文件。

    使用 locate my.cnf 命令可以列出所有的my.cnf文件

    ➜ locate my.cnf
    /etc/my.cnf
    /usr/local/mysql/mysql-test/include/default_my.cnf
    /usr/local/mysql/mysql-test/suite/federated/my.cnf
    /usr/local/mysql/mysql-test/suite/ndb/my.cnf
    /usr/local/mysql/mysql-test/suite/ndb_big/my.cnf
    /usr/local/mysql/mysql-test/suite/ndb_binlog/my.cnf
    /usr/local/mysql/mysql-test/suite/ndb_ddl/my.cnf
    /usr/local/mysql/mysql-test/suite/ndb_memcache/my.cnf
    /usr/local/mysql/mysql-test/suite/ndb_rpl/my.cnf
    /usr/local/mysql/mysql-test/suite/ndb_team/my.cnf
    /usr/local/mysql/mysql-test/suite/ndbcluster/my.cnf
    /usr/local/mysql/mysql-test/suite/rpl/my.cnf
    /usr/local/mysql/mysql-test/suite/rpl/extension/bhs/my.cnf
    /usr/local/mysql/mysql-test/suite/rpl_ndb/my.cnf
    

    1. 查看是否指定目录下的my.cnf

    ➜ ps aux | grep mysql | grep 'my.cnf'
    

    命令输出结果中的--defaults-file,就是mysql启动加载的配置文件。如果没有输入结果,则表示没有设置使用指定目录的my.cnf。

    2. 查看mysql默认读取的my.cn

    ➜ mysql --help|grep 'my.cnf'
    
                          order of preference, my.cnf, $MYSQL_TCP_PORT,
    /etc/mysql/my.cnf /etc/my.cnf ~/.my.cnf
    

    命令mysql --help|grep 'my.cnf' 查看mysql默认读取的my.cnf,按照从前到后的优先级排序,前面的不存在,则读取后面的。通常配置在/etc/my.cnf

  • 相关阅读:
    2019春季总结
    求最大值及其下标
    课程设计第四次作业
    课程设计第三次作业
    课程设计第一次作业
    课程设计第二次作业
    第十二周作业
    第十一周作业
    第十周作业
    第二次作业
  • 原文地址:https://www.cnblogs.com/jtlgb/p/13376125.html
Copyright © 2020-2023  润新知