Site icon moneyslow.com

如何知道mysql当前使用的my.cnf的路径

mysql数据库技巧

mysql数据库技巧

如果不知道当前使用的配置文件的路径,可以尝试下面的操作:
# which mysqld
/usr/local/mysql/bin/mysqld
[root@iji ~]#  /usr/local/mysql/bin/mysqld --verbose --help |grep -A 1 'Default options'
2018-05-26 23:45:23 0 [Note] /usr/local/mysql/bin/mysqld (mysqld 5.6.27-log) starting as process 11571 ...
2018-05-26 23:45:23 11571 [Note] Plugin 'FEDERATED' is disabled.
Default options are read from the following files in the given order:
/etc/mysql/my.cnf /etc/my.cnf ~/.my.cnf 
2018-05-26 23:45:23 11571 [Note] Binlog end
2018-05-26 23:45:23 11571 [Note] Shutting down plugin 'MyISAM'
2018-05-26 23:45:23 11571 [Note] Shutting down plugin 'CSV'
Exit mobile version