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.
-
What command are you executing? – thefourtheye May 05 '13 at 14:41
-
Sudo mysql -u root -p @thefoutheye – pamodulus May 05 '13 at 15:07
-
Try `ps -eaf | grep -in mysql` and post the result – thefourtheye May 05 '13 at 15:08
-
210:1000 13296 5531 0 16:08 pts/1. 00:00:00 grep --color=auto in mysql – pamodulus May 05 '13 at 15:11
-
How did you install mysql? with `apt-get install`? – thefourtheye May 05 '13 at 15:30
-
Nope, I copied .deb mysql files from a server(ubuntu 13.04) iso file, since I don't have internet access, but even when I used apt-get install, I had the same error – pamodulus May 05 '13 at 15:34
-
What do you think I should do? @thefourtheye – pamodulus May 05 '13 at 15:51
-
Did u ever find a permanent solution ? If yes, then pls post the answer here. I am facing same issue. – Reena Parekh Jun 27 '16 at 12:39
3 Answers
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
- 171
- 5
sudo service mysql start
Execute this command to start the MySQL server.
- 4,894
- 2
- 24
- 32
-
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 05 '13 at 16:38
-
If server is up, `ps -eaf | grep -in mysql` would have shown that in the output – thefourtheye May 05 '13 at 16:46
-
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.
- 126
- 3