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!