包括報錯
mysql8.0報錯ERROR 1396 (HY000): Operation ALTER USER failed for ‘root‘@‘localhost‘
-- 查詢一下安全模式開關 show variables like 'sql_safe_updates';
-- 關閉安全模式 set sql_safe_updates = 0;
-- 關閉安全模式下,纔可以執行authentication_string爲空 update user set authentication_string='' where user='root';
-- authentication_string空了的情況下,纔可以真正修改密碼 -- 刷新權限表 flush privileges;
查詢對應的host
select user, host from user;
選擇其中一個;“%” 這個位置對應的是host的值
-- 修改密碼 alter user 'root'@'%' identified by 'S32*sdf312@'; alter user 'root'@'localhost' identified by 'S32*sdf312@';
搜索
複製