# 方式一
ps -ef|grep mysql|grep 'my.cnf'
# 方式二
mysql --help|grep 'my.cnf'
# 方式三
find / -name my.cnf
default search path
/etc/my.cnf
/etc/mysql/my.cnf
/usr/local/etc/my.cnf
~/.my.cnf
Refer to
MySQL to view the currently used configuration file my.cnf method