Thursday, January 13, 2011

What does /etc/init.d/mysqld start really do?

Well I started mysql using the following
# /etc/init.d/mysqld start

First let us see what the script /etc/init.d/mysqld does when "start" is passed to it.

1. It creates the error log file /var/log/mysqld.log

2. Changes the permission of the owner and group to "mysql"

3. If /var/lib/mysql/mysql is not present, then initialize the database by running the script /usr/bin/mysql_install_db

4. Change the user and group of /var/lib/mysql to "mysql", and the permission of it to 0755

5. Next call /usr/bin/mysqld_safe and pass it the data directory, socket file name, error log file, the pid file name, and the user name.

6. Finally check if the server has come up by checking the response /usr/bin/mysqladmin

No comments: