Where is the MySQL database process pidfile file?Query MySQL pidfile command

Since the MySQL process on Linux systems can sometimes crash, and installing and configuring the MONIT monitoring program requires accessing the MySQL system process's pidfile, but no one knows where or how to find this pidfile, I'm sharing this information here!

The following two SSH commands can view the mysql process:

ps -ef|grep mysqld

watch -n 1 "ps -ef | grep mysql"

SSH returns the query results as follows:

root 6206 1 0 16:19 ? 00:00:00 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --pid-file=/var/lib/mysql/centos-ufo.pid
mysql 6280 6206 3 16:19 ? 00:00:22 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib/mysql/plugin --user=mysql --log-error=/var/lib/mysql/centos-ufo.err --pid-file=/var/lib/mysql/centos-ufo.pid
root 6691 1844 0 16:29 pts/0 00:00:00 grep mysqld

Comment

Your email address will not be published. Required fields are marked with * .

Scroll to Top