Linux-mysql8.0 password reset problem – error 1396 (HY000): Operation alter user failed for ‘root’ @’localhost ‘

Step 1: open my.cnf configuration file and add skip-gran-tables


. CNF cannot be found, so you can edit a

by yourself in /etc. Step 2: restart mysql

step 3: after login, leave the password empty and modify it. Otherwise, an error will be reported
Update User Set Authentication_string = ‘” Where user=’ root ‘;
ALTER USER ‘root’ @’ localhost ‘IDENTIFIED WITH mysql_native_password BY’ password ‘;
ALTER USER ‘root’ @’ localhost ‘IDENTIFIED WITH mysql_native_password BY’ password ‘

Read More: