Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in SQL by (6.1k points)

After running the command mysql -v in Ubuntu Operating System, I am getting the below error:

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

1 Answer

0 votes
by (12.7k points)

I think that this is because you were using the client software and not the server.

  • mysql is client
  • mysqld is the server

Try: sudo service mysqld start

To check that service is running use: ps -ef | grep mysql | grep -v grep.

Uninstalling:

sudo apt-get purge mysql-server

sudo apt-get autoremove

sudo apt-get autoclean

Re-Installing:

sudo apt-get update

sudo apt-get install mysql-server

Backup entire folder before doing this:

 sudo rm /etc/apt/apt.conf.d/50unattended-upgrades*

sudo apt-get update

sudo apt-get upgrade

Interested in SQL ? Check out this SQL Certification by Intellipaat.

For more information visit :

Related questions

0 votes
1 answer
asked Jan 3, 2021 in SQL by Appu (6.1k points)
0 votes
1 answer
0 votes
1 answer
asked Dec 15, 2020 in SQL by Appu (6.1k points)
0 votes
1 answer

Browse Categories

...