Under MySql 5.7.17 the mentioned instruction do not work and always I get no feedback or the following error message:
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 'UPDATE mysql.user SET password=password("elephant7") where user="root"' at line ...
I tried the following UPDATE
on the command line:
UPDATE mysql.user SET Password = PASSWORD('elephant7') WHERE User='root';
I really don't see anymore my mistake. I also tried without ;
.
It's not recommended to change the password in this way using
UPDATE
directly on themysql.user
table. You should useSET PASSWORD
instead:More information on MySQL: Assigning Account Passwords
Your
UPDATE
command perhaps doesn't work because thepassword
column get replaced byauthentication_string
on MySQL 5.7.6.In case you directly change the grant tables you also have to reload the tables by using the
FLUSH PRIVILEGES
statement:So your
UPDATE
command to directly change the password on the grant tables have to look like this, using the correct column and theFLUSH PRIVILEGES
statement: