panthro
panthro

Reputation: 24061

Update mysql root user password?

How can I update the root users authentication string in mysql 5.7?

I've tried:

UPDATE mysql.user SET authentication_string='-?"adBSasfasdfAWw-9?^2}-H'%KLP@' WHERE user='root';

But no luck.

Where am I going wrong?

Upvotes: 0

Views: 510

Answers (1)

Bill Karwin
Bill Karwin

Reputation: 562250

Read https://dev.mysql.com/doc/refman/5.7/en/assigning-passwords.html

And use SET PASSWORD FOR 'root'@'localhost';

Don't update MySQL password data directly, because different authentication plugins may hash the password differently. SET PASSWORD takes this into account.

And don't post your root password on the internet. :-)

Upvotes: 1

Related Questions