Cannot access phpmyadmin. Everytime I enter the username and password the given error is shown...

2002 - Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

The server is not responding (or the local server's socket is not correctly configured).

  • I added an image to show there was no mysqld in /usr/bin
    – yorroy
    Commented May 19, 2015 at 19:05

3 Answers 3


I had this error and it caused me a lot of headaches! However, I found that restarting SQL fixed it for me. I had to try restarting a couple of times but it did eventually work. I used the Stop command followed by the Start command.

The commands you want are:


sudo /etc/init.d/mysql start


sudo /etc/init.d/mysql stop

Restart / reload configs:

sudo /etc/init.d/mysql restart

These were taken from:



Try walking through the set up steps for the pset again. You may not have correctly configured the permissions. Did you get any errors when trying to modify the host file as specified in the pset instructions below?

sudo gedit /etc/hosts in order to run gedit as the appliance’s "superuser" (aka "root") so that you can edit what’s otherwise a read-only file. Carefully add this line at the bottom of that file, which will associate pset7 with the appliance’s "loopback" address (which won’t ever change): pset7 Then save the file and quit gedit.

If that fails to help, you may want to reference this thread on StackExchange.


  • I went thru all the startup steps again. I had an experienced programmer look at my appliance and he said the problem is that mysql is not running on my appliance. He said I needed to get instructions for how to get it to run on this appliance. Can someone help with that? Or should I reinstall the appliance?
    – yorroy
    Commented May 19, 2015 at 19:03

enter image description hereI checked the /etc/hosts several times It has the line suggested. I've been browsing the stackexchange thread but when I do things like mysql.server start, I get mysqlserver: command not found. I've gone back and checked all the file and directory permissions. Most of the stackexchange comments I don't understand. They reference my.cnf which I can't find. enter image description here

  • Are you using virtualbox, VMware player, fusion? Also, have your run update50
    – lethaljd
    Commented May 19, 2015 at 19:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .