MySQL數據庫進程pidfile文件在哪裡?查詢MySQL pidfile命令

由於Linux系統的MySQL的進程會出現宕機的情況,但是安裝配置MONIT監控程序,需要調用MySQL的系統進程的pidfile文件,卻不知道在哪裡找到這個pidfile文件,更不知道如何找到這個MySQL的pidfile文件,所以在此分享給大家!

以下2個SSH命令,都能查看mysql進程:

ps -ef|grep mysqld

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

SSH返回查詢結果如下:

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

發表評論

您的郵箱地址不會被公開。 必填項已用 * 標註

回到頁首