Home > Database > Mysql Tutorial > body text

如何找到MySQL配置文件?

WBOY
Release: 2016-06-07 16:38:45
Original
1277 people have browsed it

在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

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!