mysql-創建用戶報錯ERROR 1396 (HY000): Operation CREATE USER failed for 'root'@'localhost'


創建用戶:
create user ‘test’@’%’ identified by ‘test’;
顯示ERROR 1396 (HY000): Operation CREATE USER failed for ‘test’@’%’
查看是不是存在這個用戶
select user from user;
發現沒有這個用戶。
記得上次有刪除過這個用戶。可能沒有刷新權限
flush privileges;
之后還是不行報錯ERROR 1396 (HY000): Operation CREATE USER failed for ‘test’@’%’
沒辦法再刪除一次:
drop user ‘test’@’%’;
flush privileges;
之后create user ‘test’@’%’ identified by ‘test’;
成功。
網上找了下原因:
Assume the user is there, so drop the user
After deleting the user, there is need to flush the mysql privileges
Now create the user.


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM