I have confusion while I’m execute the command “# find / -name mysqld”. Because the mysqld is located in four places which are:
- /usr/libexec/mysqld
- /etc/rc.d/init.d/mysqld
- /var/lock/subsys/mysqld
- /var/run/mysqld
What is the purpose of another three mysql daemons?
Here is the following explanations
If you run
which mysqldyou should see the first oneYou never run that directly
When you run
service mysqld start, it calls/etc/rc.d/init.d/mysqldto kickoff a program calledmysqld_safe(Runwhich mysqld_safe).mysqld_safeandmysqldwork together to be the server daemon.In turn,
mysqld_safewill kickoff mysqld and then checks for an exit code. You can runless /etc/rc.d/init.d/mysqldand see this. If mysqld did not end due to system shutdown or a normalservice mysql stop, mysqld_safe will attempt to restartmysqld.