1、首先先看看你的mysql在哪,通过which命令
which mysql会得到如下结果
[zz@localhost ~]$ which mysql
/usr/bin/mysql
2、针对此位置的MySQL查看配置文件路径
/usr/bin/mysql --verbose --help | grep -A 1 ‘Default options’
结果如下所示:
[zz@localhost ~]$ /usr/bin/mysql --verbose --help | grep -A 1 'Default options'
Default options are read from the following files in the given order:
/etc/my.cnf /etc/mysql/my.cnf /usr/local/mysql/etc/my.cnf ~/.my.cnf