简体   繁体   中英

pid-file parameter being ignored in my.cnf

As the title says, I am having issues in Mysql 5.7 getting the startup script to recognize the pid-file value i am placing in my.cnf.

[root@testbox01 local]# /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 /usr/etc/my.cnf ~/.my.cnf

in my current /etc/my.cnf

[mysqld]

pid-file = /var/lib/mysql/mysqld.pid

[mysqld_safe]

pid-file = /var/lib/mysql/mysqld.pid

However

mysql> select @@pid_file;
+----------------------------+
| @@pid_file                 |
+----------------------------+
| /var/run/mysqld/mysqld.pid |
+----------------------------+
1 row in set (0.00 sec)

I saw Bug #84172 The pid-file value is ignored in the /etc/my.cnf option file but it mentions placing the pid-file value under [mysqld_safe] which i am also doing. Does anyone have further insight or thoughts on this?

Rather than using the default init scripts, I wrote a unit for mysql using systemd. pid is being placed with no issues now.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM