Issue with MySql Server connection

–1 vote

I was able to connect to MySQL server a few days back but since today I am getting an error while connecting through the command line. Below is the error from the command line:

[user@localhost ~]$ sudo mysql -u root -p
[sudo] password for user: 
Enter password: 
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111)
Jan 2, 2019 in Big Data Hadoop by digger
• 26,740 points
746 views

1 answer to this question.

0 votes

Try to restart the mysqld server and then login:

sudo service mysqld restart
mysql -u root -p

If that doesn't not work then try the following:

sudo pkill mysql
sudo pkill mysqld
restart mysql
sudo service mysql restart

now you should be able to log in

mysql -u root -p
answered Jan 2, 2019 by Omkar
• 69,220 points

Related Questions In Big Data Hadoop

0 votes
1 answer

Command to establish connection between MySql with linux?

This is the command you can use ...READ MORE

answered Apr 15, 2019 in Big Data Hadoop by Gitika
• 65,770 points

edited Apr 18, 2019 by Gitika 1,067 views
0 votes
1 answer
0 votes
1 answer

Running into an issue while running the mapred job on the server

Try this command hadoop dfs -put /var/tmp/students.txt / hadoop ...READ MORE

answered Dec 20, 2018 in Big Data Hadoop by Omkar
• 69,220 points
508 views
0 votes
1 answer

"Cant connect to local mysql server through socket "var/lib/mysql/mysql.sock" .

Seems like mysql.sock does not exist in the ...READ MORE

answered Dec 26, 2018 in Big Data Hadoop by Omkar
• 69,220 points
1,676 views
0 votes
1 answer

Update hdfs data before stroring in MySql

Yes, you can update the data before ...READ MORE

answered Jan 27, 2019 in Big Data Hadoop by Omkar
• 69,220 points
789 views
0 votes
1 answer

Using Hadoop for Data Analytics.

Yes, your approach is correct - you ...READ MORE

answered Sep 28, 2018 in Big Data Hadoop by Frankie
• 9,830 points
763 views
0 votes
1 answer

How to open MySql console in Ubuntu?

sudo service mysqld restart mysql -u <username> root ...READ MORE

answered Dec 14, 2018 in Big Data Hadoop by Omkar
• 69,220 points
2,582 views
–1 vote
1 answer

Facing the below error while installing mysql in VM

We would like to say that the ...READ MORE

answered Dec 21, 2018 in Big Data Hadoop by Omkar
• 69,220 points
979 views
0 votes
1 answer

MySql connection problem "Cant connect to local mysql server through socket "var/lib/mysql/mysql.sock" .

First start the mysql server: service mysqld start To ...READ MORE

answered Dec 26, 2018 in Big Data Hadoop by Omkar
• 69,220 points
1,182 views
0 votes
1 answer

Hbase: Client not able to connect with remote Hbase server

You have to remove the localhost entry from hbase server's ...READ MORE

answered Nov 8, 2018 in Big Data Hadoop by Omkar
• 69,220 points
5,494 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP