Never get stuck again with no way to log into your MySQL database.
In a Unix shell:
/etc/init.d/mysql stop mysqld_safe --skip-grant-tables & mysql -u root
Then in the MySQL shell:
use mysql; update user set password=PASSWORD("NEW-ROOT-PASSWORD") where User='root'; flush privileges; quit
Then back in the Unix shell:
/etc/init.d/mysql stop; /etc/init.d/mysql start mysql -u root -p
Your email is never published nor shared. Required fields are marked *
You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>
I've got a masters degree in computer science and over 10 years of experience building web-based systems using Java/J2EE, Ruby, Rails and PHP. I'm a strong believer in the effectiveness of Agile Methods. Read more »
How to Reset the Root Password in MySQL
Never get stuck again with no way to log into your MySQL database.
In a Unix shell:
Then in the MySQL shell:
use mysql; update user set password=PASSWORD("NEW-ROOT-PASSWORD") where User='root'; flush privileges; quitThen back in the Unix shell: