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

My mysql installation was screwed up. I uninstalled and installed it multiple times. But I kept getting a hang or a error "cant connect". I now finally have it running with sudo -u mysql mysqld. How do I get mysqld to run at startup, and why do I need to run it as user mysql. Can I change it to run as root ?


Filesystem            Size  Used Avail Use% Mounted on
/dev/sda1             230G  5.5G  213G   3% /
none                  2.0G  268K  2.0G   1% /dev
none                  2.0G  3.2M  2.0G   1% /dev/shm
none                  2.0G   92K  2.0G   1% /var/run
none                  2.0G     0  2.0G   0% /var/lock
none                  2.0G     0  2.0G   0% /lib/init/rw
/dev/sda5             230G   20G  199G   9% /home
share|improve this question
How about starting mysql as a service? Like sudo service mysql start What is the output from the above command? – Minh Danh Nov 2 '12 at 3:41
I get this error start: Job failed to start – Siddharth Nov 2 '12 at 9:04
Where do you store your mysql data? Is the partition which stores those data full? By the way, check mysql log files at /var/log/mysql.log and /var/log/mysql.err – Minh Danh Nov 2 '12 at 9:28
Both the files are empty. Worse case scenario. – Siddharth Nov 2 '12 at 9:33
How about df -h? What is the output of the command? – Minh Danh Nov 2 '12 at 10:11
up vote 1 down vote accepted

You can add mysql as a service with sudo service mysql start as Minh Danh said in the comment.

Daemons are given their own users to allow for better permissions control.

share|improve this answer

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.