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 mysqldwatch -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 mysqldHopefully, the article "Where is the MySQL database process pidfile? The command to query the MySQL pidfile" shared on Chen Weiliang's blog ( https://www.chenweiliang.com/ ) will be helpful to you.
Feel free to share this article's link: https://www.chenweiliang.com/cwl-438.html
