1

I am a newbie to SQL, I am following a course where I was asked to change the password.

I inserted this command:

UPDATE mysql.user SET authentication_string=PASSWORD(‘password’) WHERE User='root';

and received this error msg:

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '('pwd') WHERE User='root'' at line 1

I tried option presented in this post: ERROR 1064 (42000): You have an error in your SQL syntax; Want to configure a password as root being the user

All of them return the same Error. Can you help? Thanks!

Javier Enciso
  • 55
  • 1
  • 2
  • 11
karochacha
  • 11
  • 3

1 Answers1

0

The solution to this problem is to remove: PASSWORD after the authentication_string attribute. The field has been deprecated.

So, this should work:

UPDATE mysql.user SET authentication_string=‘password’ WHERE User='root';
scopchanov
  • 7,966
  • 10
  • 40
  • 68
  • With this command the password will not be hashed, it will be saved as is! if you run the command `SELECT user, authentication_string FROM mysql.user;` you will that the `root` user will have `password` as password. – Yacine Rouizi May 14 '21 at 17:50