Reset Mysql Temp Password

How to reset the temporary password if you missed to copy it during installation process 🙂

When Mysql install runs in the end it shows a popup with temporary password. However sometime I have experienced for some reasons this popup does not appear or you miss to copy the password. In that case problem is we cannot login to mysql root until we reset the password. Here are steps to reset the password.

– open Terminal and type command
sudo mysqld_safe --skip-grant-tables
– This command will run a mysqld daemon. So now open another Terminal window
– In new window type command
mysql -uroot
– This will login you as root and now we need to reset the password
use mysql;
UPDATE mysql.user SET authentication_string = PASSWORD(“write_new_password_here”) , password_expired = 'N' WHERE User = 'root' AND Host = 'localhost';
– Then EXIT and sign in again with new password


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

Create a website or blog at

Up ↑

%d bloggers like this: