Update MySQL password on Mac

$ mysql -u root
mysql> USE mysql;  
mysql> UPDATE user SET password=PASSWORD("NEWPASSWORD") WHERE User='root';  
mysql> FLUSH PRIVILEGES;  
mysql> quit  

MySQL 5.7, the password field has been renamed authentication_string

$ mysql -u root
mysql> USE mysql;  
mysql> UPDATE user SET authentication_string=PASSWORD("NEWPASSWORD") WHERE User='root';  
mysql> FLUSH PRIVILEGES;  
mysql> \q

That's all folks!

Victor Velazquez

Coder, Musician, Startups, Passionate Dancer & Life Lover. Software Engineer at MagmaLabs, Co-founder of Web Dev Talks, Co-founder of Voltaire, Co-founder of Paqkit, Ex-co-founder of Zaznova.

Subscribe to The zazvick's blog

Get the latest posts delivered right to your inbox.

or subscribe via RSS with Feedly!