• Register
0 votes
46 views

Problem :

My problem started with me when I was unable to log in as root any more on the mysql install. I was trying to run mysql without passwords turned on... but whenever I ran the below command

# mysqld_safe --skip-grant-tables &

I would never get my prompt back to just start typing my SQL commands to reset my password.

When I try to kill it by pressing ctrl +c I get the below message:

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

Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists!
6 5 3
7,540 points

Please log in or register to answer this question.

1 Answer

0 votes

Solution :

I had also faced the same error in the recent past.

This error usually occurs due to the multiple installations of mysql.

You need to Run the below command :

ps -A|grep mysql

Kill your process by using below command :

sudo pkill mysql

And after that you need to run the below command :

ps -A|grep mysqld

Also Kill your process by running below command :

sudo pkill mysqld

Now you are completely set just you need to run the below commands :

service mysql restart
mysql -u root -p

That’s it you are all set now !! Have a very well working Mysql again !!

 

9 7 4
38,600 points

Related questions

1 vote
1 answer 5 views
5 views
Problem : I'm new to Linux and MySQL, I currenty have a LAMP, running on Ubuntu 14.04, yesterday everything was fine, but today my MYSQL is not working.I get the following error message: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) I have no ideia about what to do!
asked Mar 31 Shovo210 14k points
0 votes
1 answer 95 views
95 views
Problem : My problem kicked off when I was unable to log in as the root any more on the mysql install. I was trying to run mysql without the passwords turned on however when I ran my below command : # mysqld_safe --skip-grant-tables & I never got my prompt back. ... socket '/var/run/mysqld/mysqld.sock' (2)' Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists!
asked Jan 4, 2020 alecxe 7.5k points
0 votes
1 answer 11 views
11 views
Problem: How to fix this Error 2002 (hy000): can't connect to local mysql server through socket '/tmp/mysql.sock' (38).
asked Apr 1 rakib1 51.5k points
0 votes
1 answer 3 views
3 views
Problem: I need assistance in resolving this problem: Can't connect to local mysql server through socket '/var/lib/mysql/mysql.sock' (13).
asked Apr 1 rakib1 51.5k points
0 votes
0 answers 110 views
0 votes
1 answer 3 views
3 views
Problem: How to fix this issue? error: can't connect to local mysql server through socket '/tmp/mysql.sock' (2)
asked Apr 3 ashik 12.9k points
0 votes
1 answer 2 views
2 views
Problem: What are my options for dealing with this issue? mysql2::error: can't connect to local mysql server through socket '/tmp/mysql.sock' (2)
asked Apr 1 rakib1 51.5k points
1 vote
1 answer 50 views
50 views
Problem : I am very new to MySQL Server. I am newly assigned to this MySQL Server project. If I try to connect with the local MySQL server during my assigned test suite it shows me the below error: "Can't connect to local MySQL server through socket '/tmp/ ... that exception I can connect with my exact same parameters. I am very confused about above error. Can some expert help me in fixing it?
asked Apr 8, 2020 morrisBson 3.2k points
1 vote
1 answer 182 views
182 views
Problem : Encountered bellow docker error cannot connect to the docker daemon at unix:///var/run/docker.sock. is the docker daemon running?
asked Nov 8, 2019 peterlaw 6.9k points
0 votes
1 answer 2 views
2 views
Problem: If I can’t connect to local mysql server through socket .. so what should I do?
asked Mar 25 Ifra 24.4k points