# Can't connect to local MySQL server through socket '/tmp/mysql.so



## adzzz (Feb 22, 2010)

Hello All,

I am having some issues with connecting to mysql locally to perform a password reset. The error that I get is:


```
[-su|root@gadget:~] # mysqld_safe --skip-grant-tables &
[1] 73309
[-su|root@gadget:~] # 100219 14:14:39 mysqld_safe Logging to '/var/db/mysql/gadget.pchelpline.com.err'.
100219 14:14:39 mysqld_safe Starting mysqld daemon with databases from /var/db/mysql
100219 14:14:39 mysqld_safe mysqld from pid file /var/db/mysql/gadget.pchelpline.com.pid ended
mysql -u root
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
[1]+  Done                    mysqld_safe --skip-grant-tables
```

What happened is I tried resetting the root password using phpMyAdmin (Big Mistake) now neither the old nor the new root password work. 

So I tried to go through the reset procedure as documented here:
http://www.cyberciti.biz/tips/recover-mysql-root-password.html

But thats when I get the error: 
	
	



```
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
```

I have verified that the mysql.sock file does exist in that location.


----------



## DutchDaemon (Feb 22, 2010)

Is MySQL itself running?


----------



## SirDice (Feb 22, 2010)

It's either still running or failing to start. Before you can start with the --skip-grant-tables option you _must_ shutdown mysql.


----------



## adzzz (Feb 24, 2010)

Hello,

Thank you for your replies.

Yes MySQL is running. Then I shut it down to try to reset the root password. After that fails, I can start it back up again and resume using it.


----------

