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

I just installed appache, MySQL and PHP, suring my installation, I was prompted for a MySQL root user password, but when I start my MySQL, it pops the error, and I just can't seem to find a way around it, most solutions I've read doesn't solve it, moreover, I found out that the /var/run/mysqld path doesn't even exist, my php also needs the socket to connect to my Database.

share|improve this question

marked as duplicate by Luis Alvarado Jul 10 '13 at 7:35

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

What command are you executing? – thefourtheye May 5 '13 at 14:41
Sudo mysql -u root -p @thefoutheye – pamodulus May 5 '13 at 15:07
Try ps -eaf | grep -in mysql and post the result – thefourtheye May 5 '13 at 15:08
210:1000 13296 5531 0 16:08 pts/1. 00:00:00 grep --color=auto in mysql – pamodulus May 5 '13 at 15:11
How did you install mysql? with apt-get install? – thefourtheye May 5 '13 at 15:30

After checking that /etc/mysql/my.cnf was correct (port=3306, bind-address=, I was still having trouble. I then got /var/run/mysqld/mysqld.sock automatically by installing mysql-server:

$ sudo apt-get install mysql-server-5.5

I then tried starting the mysql server as thefourtheye said, but still got the same error you're getting when trying to start mysql via $ mysql -u root.

Finally, I found a similar discussion on ubuntu forums that finally fixed it for me.

Here's the only part of the link that I found I needed to do:

$ sudo service mysql stop
$ sudo /etc/init.d/apparmor reload
$ sudo service mysql start

Then I was able to start mysql with $ mysql -u root -p, using the password I set when I installed mysql-server-5.5

share|improve this answer

sudo service mysql start

Execute this command to start the MySQL server.

share|improve this answer
I've been doing just that but nothing positive, I've found out that mysql-client is not configured, maybe fixing that would help, but I don't know how to configure mysql-client, I'm sure the server is up and good @thefourtheye – pamodulus May 5 '13 at 16:38
If server is up, ps -eaf | grep -in mysql would have shown that in the output – thefourtheye May 5 '13 at 16:46
What shoult I do? – pamodulus May 5 '13 at 17:02

I once had encountered the same error message after a MySQL update. In my case, it was caused by an invalid configuration option.

The option –skip-locking was deprecated in MySQL 5.1 and removed in MySQL 5.5. You'll have to use –skip-external-locking instead.

So check, if your configuration has a line


in the [mysqld] section. If so, change it to


Don't forget to restart the server.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.