Tony
Tony

Reputation: 1011

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

where do I go to open or find the /var/lib/mysql file?

Upvotes: 2

Views: 18632

Answers (3)

Andrej
Andrej

Reputation: 7504

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

Upvotes: 8

Michael Berkowski
Michael Berkowski

Reputation: 270687

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

Upvotes: 4

Arnaud Le Blanc
Arnaud Le Blanc

Reputation: 99911

If the /var/lib/mysql directory does not exists, then the .pid in file in it can't exist.

Upvotes: 1

Related Questions