I\'m getting this error
ERROR 2002 (HY000): Can\'t connect to local MySQL server through socket \'/var/run/mysqld/mysql.sock\' (2)
even though
The same error occured with my system as well. I had to remove mysql-server and reinstall it. Not other way around. Try running these commands it it works:
My problem was solved checking if the process was running on Ubuntu 12.04
ps ax | grep mysql
Then the answer was that it wasn't running, so I did
sudo service mysql start
Or try
sudo /etc/init.d/mysql start
If you look close, you'll see the difference:
/var/run/mysqld/mysqld.sock
/var/run/mysqld/mysql.sock
You'll have to adjust the one or the other.
this worked for me
sudo /etc/init.d/mysql start
first i tried this, but i dont understand why it doesn't work this way
sudo service mysql start
I had the problem.
This process worked for me:
Ensure that during remove process you choose No to deleting database.
sudo apt-get remove --purge mysql*
sudo apt-get autoremove
sudo apt-get autoclean
sudo apt-get install mysql-server mysql-client
Note that I ran into this trouble after I upgraded my Ubuntu 14.04 distribution using apt-get upgrade
. I had to completely purge mysql-server
and mysql-client
and reinstall it to fix this issue.
sudo apt-get autoremove
sudo apt-get autoclean
sudo apt-get purge mysql-server mysql-client
sudo apt-get install mysql-server mysql-client
Hope this helps.