reset forgotten mysql password
To reset a forgotten mysql password, log in as root then find and kill the mysqld process
ps -e mysqld | grep mysqld
sudo kill -9 <mysqld-process-id>
now create a file in your home folder, “mysql-reset.txt” for example, and put these two lines in it
UPDATE mysql.user SET Password=PASSWORD(‘the-new-password’) WHERE User=’root’;
FLUSH PRIVILEGES;
then go back to the prompt and run
mysqld_safe –init-file=/path/to/the/file/mysql-reset.txt &
Advertisement
Categories: Linux