mysql 读取配置的优先级

mysql所在linux服务器执行
/usr/bin/mysql --verbose --help | grep -A 1 'Default optio'

 

输出:

Default options are read from the following files in the given order:
/etc/my.cnf    /etc/mysql/my.cnf     /usr/etc/my.cnf      ~/.my.cnf

 

 

得知  优先取 /etc/my.cnf  如果没有 再取后面的 

 

所以我们要修改mysql配置的时候  需要需改/etc/my.cnf

 

posted @ 2022-07-11 14:45  loveCrane  阅读(89)  评论(0编辑  收藏  举报