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.
After checking that /etc/mysql/my.cnf was correct (
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
I once had encountered the same error message after a MySQL update. In my case, it was caused by an invalid configuration option.
–skip-locking was deprecated in MySQL 5.1 and removed in MySQL 5.5. You'll have to use
So check, if your configuration has a line
[mysqld] section. If so, change it to
Don't forget to restart the server.