Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

MySQL server is running for 95days but the mysqld pid is changed few times. Why mysqld changes its pid, any ideas ? How can I know that the mysqld pid has changed and what is the cause behind the change of the pid ?



share|improve this question

My guess is that the server restarts itself every now and then to avoid resource leaks (memory, connections). Many big sites ran into trouble because of that in the past (server would run out of connections and not being able to answer any requests anymore), so that probably made it into the install scripts.

If you want to find out exactly, I suggest to check the crontab of root or the user the MySQL is running under.

share|improve this answer

Check if the mysql log is being rotated. The server may have been restart during log file rotate.

share|improve this answer
Thanks for the quick response. No, mysql log file is not being rotated, but "/var/log/mysqld.log" contains this error message "Got an error reading communication packets". Why am I getting this error, any idea ? Can you please tell me the possible cases where can change ? Regards Supratik – Supratik Jul 27 '09 at 16:13
This is a network problem. It comes directly from the recv() system call. Mysql PID can only change when mysql is hupped or restarted. – lsbalaji Jul 28 '09 at 5:36
This is mostly due to mysql threads not being closed properly, can you check those please. Having net_read_timeout=120 can help as a workaround but this is not the solution. – lsbalaji Jul 28 '09 at 5:38

If you want to find out what the current MySQL pid is you can find it in the file /var/run/mysqld/ (Thats in Ubuntu could be differnt in other distros).

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.