# MySQL starting with two pids

**URL:** <https://forums.percona.com/t/mysql-starting-with-two-pids/21178>\
**Category:** MySQL & MariaDB\
**Tags:** mysql\
**Created:** [April 4, 2023, 1:02pm UTC](https://forums.percona.com/t/mysql-starting-with-two-pids/21178 "2023-04-04T13:02:25Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![bKumar](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/bkumar/32/8989_2.png) [@bKumar](https://forums.percona.com/u/bKumar)\
**Post date:** [April 4, 2023, 1:02pm UTC](https://forums.percona.com/t/mysql-starting-with-two-pids/21178/1 "2023-04-04T13:02:25Z")

</div>

Hi Everyone,

When I was starting mysql , it is starting with two pid process ids are created and not starting the service.

Can you please suggest how to clear this issue.

 ![IMG_20230404_182803](https://us1.discourse-cdn.com/flex019/uploads/percona1/original/2X/b/bcb41dd3a305fcc58eca2860ef03131e8007c402.jpeg)

---

<div class="post-metadata">

**Author:** ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)\
**Post date:** [April 4, 2023, 3:20pm UTC](https://forums.percona.com/t/mysql-starting-with-two-pids/21178/2 "2023-04-04T15:20:14Z")

</div>

Hello @bKumar,  
Stop the mysql service. Check the service file does not have 2 execute lines for MySQL. Also check your /etc/my.cnf and make sure there are not multiple [mysqld] sections.

---

<div class="post-metadata">

**Author:** ![bKumar](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/bkumar/32/8989_2.png) [@bKumar](https://forums.percona.com/u/bKumar)\
**Post date:** [April 5, 2023, 10:07am UTC](https://forums.percona.com/t/mysql-starting-with-two-pids/21178/3 "2023-04-05T10:07:14Z")

</div>

Hi @matthewb ,

Yes after killing systemctl start mysqld. Only one pid is running but this killing required every time of restart of service.

No we dont have two execute lines in mysqld.service  
We have only one mysqld section.

Thanks  
Kumar

---

<div class="post-metadata">

**Author:** ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)\
**Post date:** [April 5, 2023, 4:21pm UTC](https://forums.percona.com/t/mysql-starting-with-two-pids/21178/4 "2023-04-05T16:21:30Z")

</div>

Let me understand the process. 1) Kill all mysql. No mysql running. 2) systemctl start mysql. this creates 1 instance of mysql / 1 pid. Correct? 3) systemctl restart mysql this does not stop old mysql but starts a new mysql instance/pid. Correct?

---

<div class="post-metadata">

**Author:** ![yves.trudeau](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/yves.trudeau/32/2825_2.png) [@yves.trudeau](https://forums.percona.com/u/yves.trudeau)\
**Post date:** [May 23, 2023, 8:15pm UTC](https://forums.percona.com/t/mysql-starting-with-two-pids/21178/5 "2023-05-23T20:15:45Z")

</div>

Hi @bKumar,  
I may have an explanation. So, when mysqld starts, it performs a “double fork” to detach the process from the controlling tty. When there is a need to perform things like InnoDB recovery, the “child” part of the double fork takes time to signal the parent to die. What is mysqld doing in terms of CPU and IOPs?
