D
D
Dima Sokolov2017-03-21 13:06:21
MySQL
Dima Sokolov, 2017-03-21 13:06:21

How to reset mysql password?

Doing: sudo service mysql stop
then: sudo mysqld --skip-grant-tables --user=root , after that:
mysql -u root and :
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/ var/run/mysqld/mysqld.sock' (2)
What is the reason? If you do sudo service mysql start, it connects, but you can't log in due to an incorrect password.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander Shishov, 2017-03-21
@AleX52

Try: mysqladmin -u root password NEWPASSWORD
If it doesn't help: https://www.cyberciti.biz/tips/recover-mysql-root-...

D
Dimonchik, 2017-03-21
@dimonchik2013

sudo service mysql stop
sudo dpkg-reconfigure mysql-server-5.5
sudo service mysql start

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question