简体   繁体   中英

How do I locate the .pid file in /var/lib/mysql when in terminal there is no such directory?

我在哪里打开或找到/ var / lib / mysql文件?

You can run for getting pid path.

/usr/sbin/mysqld --print-defaults | tr " " "\n" | grep pid | tail -n 1 

On debian result is --pid-file=/var/run/mysqld/mysqld.pid

If it's the process id of the mysqld service you are needing to find, then you can do:

ps aux |grep [m]ysqld

# Result something like
root      2665  0.0  0.0   4644  1288 ?        S    Jul26   0:00 /usr/libexec/mysqld
  -------^^^^^^^--- that's the pid

如果/ var / lib / mysql目录不存在,则其中的.pid文件不能存在。

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