Ask Ubuntu is a question and answer site for Ubuntu users and developers. 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

If I start MYSQL cluster server with this command I get an error:

root@v-server1:/usr/local/mysql-cluster# /etc/init.d/mysql.server start
 Starting MySQL
 The server quit without updating PID file (/var/lib/mysql/

But if I start via this command the server starts without problems:

root@v-server1:/usr/local# cd mysql-cluster

root@v-server1:/usr/local/mysql-cluster# bin/mysqld_safe --defaults-extra-file=/etc/ --user=mysql --datadir=/var/lib/mysql --basedir=/usr/local/mysql-cluster &
[1] 29119

120404 13:44:00 mysqld_safe Logging to '/var/log/mysql/error.log'.
120404 13:44:01 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
root@v-server1:/usr/local/mysql-cluster# /etc/init.d/mysql.server status
MySQL running (29524)

My problem is that I want to have the server started automatically when I switch on the system.

share|improve this question
up vote 0 down vote accepted

Find your error by checking var/log/syslog after booting or running the /etc/init.d/ script. There should be a lot of helpful information there.

My guess is that there is a problem with the command arguments or environment that the startup script is using for the start on bootup.

Another way to get things to work is to edit the startup script to give it the exact command and arguments you used when you started it successfully.

If your startup is happening from /etc/init.d/mysql.server, check that file.

On my system, mysql is started using upstart, so the file in /etc/init.d/ is only a link to the generic /lib/init/upstart-job/ script.

To do a test, I can move the variables from the successful startup command, /usr/bin/mysqld_safe --defaults-extra-file=/etc/ --user=mysql --datadir=/var/lib/mysql --basedir=/usr/local/mysql-cluster, into one of the config files.

On my system, these are my other configuration files:

/etc$ ls -lR mysql/
total 16
drwxr-xr-x 2 root root 4096 May  3 18:53 conf.d
-rw------- 1 root root  333 May  3 18:53 debian.cnf
-rwxr-xr-x 1 root root 1220 Mar 29 23:48 debian-start
-rw-r--r-- 1 root root 3504 Feb 17 16:41 my.cnf

total 4
-rw-r--r-- 1 root root 21 Mar 29 23:47 mysqld_safe_syslog.cnf

Many default values are found here. You'll notice a lot of familiar-looking environment variables in your config files (such as debian-start and my.cnf).

You will eventually want to track down defaults that are being provided from the configuration in your /etc directory. For example, see if you have files in places like /etc/mysql and /etc/default/mysql or even something like /etc/mysql.conf.

After making changes, test to see if you have replicated the working manual start-up. On my system, I can test the mysql server set-up with sudo service mysql start .

share|improve this answer
Thanks belacqua .. Fixed it :) – sundar May 8 '12 at 2:50
@sundar Glad to hear that.... – belacqua May 8 '12 at 15:10

use rc.local file for startup commands

share|improve this answer
please improve your answer ,Thank you . – Raja Sep 7 '12 at 18:21

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.