Resetting the mysql password

Start server

$ sudo service mysql start

Go to sock folder

$ cd /var/run

Back up the sock

$ sudo cp -rp ./mysqld ./mysqld.bak

Stop server

$ sudo service mysql stop

Restore the sock

$ sudo mv ./mysqld.bak ./mysqld

Start mysqld_safe

$ sudo mysqld_safe --skip-grant-tables --skip-networking &

Init mysql shell

mysql -u root

Change password


ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'root';

Stop and stop mysql

sudo service mysql stop
sudo service mysql start

This is based on the combination of a few suggestions from

Leave a Reply

Your email address will not be published. Required fields are marked *