8

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.

8
  • 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
7

After checking that /etc/mysql/my.cnf was correct (port=3306, bind-address=127.0.0.1), 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

2

sudo service mysql start

Execute this command to start the MySQL server.

3
  • 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
0

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

skip-locking

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

skip-external-locking

Don't forget to restart the server.

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