Monday 18 September 2017

Most Effective Way To Reset Your Lost Password Or Forgotten Password Of MySQL.

You have to reset the password! steps for mac osx(tested and working) and ubuntu

Stop MySQL

$ sudo /usr/local/mysql/support-files/mysql.server stop


Start mysql in safe mode:

$ sudo mysqld_safe --skip-grant-tables

(above line is the whole command)

This will be an ongoing command until the process is finished so open another shell/terminal window, log in without a  password:

$ mysql -u root

Now:

mysql> UPDATE mysql.user SET Password=PASSWORD('password') WHERE User='root';


$ sudo /usr/local/mysql/support-files/mysql.server start

your new password is 'password'.

No comments:

Post a Comment