Heim > Datenbank > MySQL-Tutorial > Hauptteil

如何找到MySQL配置文件?

WBOY
Freigeben: 2016-06-07 16:38:45
Original
1276 Leute haben es durchsucht

在Unix, Linux and Mac OS X 系统中,官方MySQL程序推荐从下面的文件指定的顺序读取启动配置选项: /etc/my.cnf /etc/mysql/my.cnf user-home-dir/my.cnf $MYSQL_HOME/my.cnf 其中$MYSQL_HOME 是指MySQL安装的路径,默认安装在/var/lib/mysql。 在实际环境中

在Unix, Linux and Mac OS X 系统中,官方MySQL程序推荐从下面的文件指定的顺序读取启动配置选项:

/etc/my.cnf
/etc/mysql/my.cnf
user-home-dir/my.cnf
$MYSQL_HOME/my.cnf

其中$MYSQL_HOME 是指MySQL安装的路径,默认安装在/var/lib/mysql。

如何找到MySQL配置文件

在实际环境中,需要准确找到MySQL的配置文件位置,我们可以尝试一下方法。

查看开始MYSQL进程命令的全部命令:

[root@localhost ~]# cat /proc/$(pidof mysqld)/cmdline | tr ‘\0′? ‘\n’
/usr/local/mysql/libexec/mysqld
–basedir=/usr/local/mysql
–datadir=/var/lib/mysql
–user=mysql
–log-error=/var/log/mysqld.log
–pid-file=/var/run/mysqld/mysqld.pid
–socket=/var/lib/mysql/mysql.sock

但这种方法也并不是100%准确的,它可能不会告诉你实际使用的配置文件位置(如上)。

(...)
Read the rest of 如何找到MySQL配置文件? (42 words)


© lixiphp for LixiPHP, 2013. | Permalink | No comment | Add to del.icio.us
Post tags: my.cnf, MySQL, mysqld

Feed enhanced by Better Feed from Ozh

Verwandte Etiketten:
Quelle:php.cn
Erklärung dieser Website
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn
Beliebte Tutorials
Mehr>
Neueste Downloads
Mehr>
Web-Effekte
Quellcode der Website
Website-Materialien
Frontend-Vorlage
Über uns Haftungsausschluss Sitemap
Chinesische PHP-Website:Online-PHP-Schulung für das Gemeinwohl,Helfen Sie PHP-Lernenden, sich schnell weiterzuentwickeln!