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 in Big Data Hadoop by digger
• 26,550 points
25 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 by Omkar
• 67,660 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 in Big Data Hadoop by Gitika
• 25,360 points

edited Apr 17 by Gitika 67 views
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
• 67,660 points
51 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
• 67,660 points
142 views
0 votes
1 answer

Update hdfs data before stroring in MySql

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

answered Jan 27 in Big Data Hadoop by Omkar
• 67,660 points
38 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,810 points
43 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
• 67,660 points
121 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
• 67,660 points
68 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
• 67,660 points
354 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
• 67,660 points
844 views