获取MySQL配置文件路径

xiaoxiao2021-02-28  139

在实际工作中,MySQL可能会涉及多个配置文件,但是因为各种原因我们无法找到它们的路径,那么我们可以通过以下命令找到:

首先找到mysqld的路径:

$ which mysqld /usr/sbin/mysqld

通过mysqld找到所有配置文件的路径:

$/usr/sbin/mysqld --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 ~/.my.cnf

于是就得到了所有配置文件可能的路径。

转载请注明原文地址: https://www.6miu.com/read-19640.html

最新回复(0)