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.

pamodulus
  • 81
  • 1
  • 1
  • 2

3 Answers3

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.

thefourtheye
  • 4,924
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.

nibra
  • 126
  • 3