0

I try to alter mysql root password on ubuntu 16 under Digital Ocean. I suppose command format is :

ALTER USER 'root'@'localhost' IDENTIFIED BY 'New password';

and I failed below :

root@ubuntu-server:~# mysql -u root -h localhost -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 13494
Server version: 5.7.31-0ubuntu0.16.04.1 (Ubuntu)

Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'NEWPASSWORD';
ERROR 1396 (HY000): Operation ALTER USER failed for 'root'@'localhost'
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'NEWPASSWORD';
ERROR 1396 (HY000): Operation ALTER USER failed for 'root'@'localhost'
mysql> ALTER USER 'root'' IDENTIFIED BY 'NEWPASSWORD';
'>
'> ;
'>

Why I got message :

Operation ALTER USER failed for...

last command I tried hang up... Why error? Ate there some error code checking?

I suppose this is different root password from access to OS ?

Thanks!

mstdmstd
  • 2,195
  • 17
  • 63
  • 140
  • 1
    https://stackoverflow.com/questions/5555328/error-1396-hy000-operation-create-user-failed-for-jacklocalhost indicates a `FLUSH PRIVILEGES` may clear this up. – ceejayoz Oct 26 '20 at 11:15
  • FLUSH PRIVILEGES; is useful after successful command , but I got error ERROR 1396 (HY000): Operation ALTER USER failed for 'root'@'localhost' and winder why ? – mstdmstd Oct 26 '20 at 11:20
  • 1
    The linked question indicates it may clear up a bug in your scenario; did you try it? – ceejayoz Oct 26 '20 at 11:29

0 Answers0