Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 02-17-2005, 01:03 PM   #1
LQ Newbie
Registered: Jan 2005
Location: Scotland
Distribution: Suse 9.1
Posts: 2

Rep: Reputation: 0
Unhappy Why are multiple instances of mysqld running?

When I look at the Process Table in KDE System Guard it shows 10 instances of mysqld running - each with a different PID.
How do I go about finding what and how these are being started?

Old 02-17-2005, 01:51 PM   #2
Senior Member
Registered: Nov 2000
Location: Seattle, WA USA
Distribution: Ubuntu @ Home, RHEL @ Work
Posts: 3,892
Blog Entries: 1

Rep: Reputation: 67
You a ps -aeLf | grep mysqld

You should get something like this:

root       958     1   958  0    1 14:38 ?        00:00:00 /bin/sh /usr/bin/mysqld_safe
mysql     5196   958  5196  0    1 14:38 ?        00:00:00 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --pid-file=/var/run/mysqld/ --skip-locking --port=3306 --socket=/var/run/mysqld/mysqld.sock
mysql    30966  5196 30966  0    1 14:38 ?        00:00:00 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --pid-file=/var/run/mysqld/ --skip-locking --port=3306 --socket=/var/run/mysqld/mysqld.sock
mysql    10776 30966 10776  0    1 14:38 ?        00:00:00 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --pid-file=/var/run/mysqld/ --skip-locking --port=3306 --socket=/var/run/mysqld/mysqld.sock
mysql     1036 30966  1036  0    1 14:38 ?        00:00:00 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --pid-file=/var/run/mysqld/ --skip-locking --port=3306 --socket=/var/run/mysqld/mysqld.sock
root      4024  8245  4024  0    1 14:46 pts/2    00:00:00 grep mysqld
Now, following this you can see /usr/bin/mysqld_safe was executed (PID 958). This in turn called mysqld (PID 5196). That mysqld called another mysqld (PID 30966) which in turn called two more mysqld's (PID 10776 and 1036). You can tell this because PPID shows you the parent process.

Now the mysqld_safe in my case was has a parent of PID 1, which is init, which usually means it was executed by the init scripts.

The reason mysql works starts multiple processes/threads is because it can run more efficiently that way.

Last edited by jtshaw; 02-17-2005 at 01:52 PM.
Old 02-17-2005, 03:01 PM   #3
LQ Newbie
Registered: Jan 2005
Location: Scotland
Distribution: Suse 9.1
Posts: 2

Original Poster
Rep: Reputation: 0

What an excellent, clear and well illustrated answer. I now understand what is going on.
Many thanks.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiple instances of artsd Mojojo Linux - Software 0 10-13-2005 11:41 AM
SAMBA: Multiple Instances? Matir Linux - Software 0 02-18-2005 10:43 AM
Multiple Instances of MPlayer? Levitate Linux - Software 2 01-13-2005 12:04 PM
Multiple instances of PHP cubax Linux - Newbie 6 12-30-2004 08:04 PM
Mplayer and Multiple instances Spaz007 Linux - Software 0 09-16-2004 10:59 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:32 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration