Pages

Sunday, January 19, 2014

How to Change the MySQL root Password in Linux or OSX via Command Line

If you have forgot the MySQL root password, can’t remember or want to break in….. you can reset the mysql database password from the command line in either Linux or OS X as long as you know the root user password of the box you are on:
Stop MySQL
Start it in safe mode:
This will be an ongoing command until the process is finished so open another shell/terminal window, log in without a password:
Change the lowercase password to what you want – with single quotes.
Start MySQL