mysql授權修改密碼

mysql 更改密碼
update mysql.user set authentication_string=password('123456') where user='root';
提示報錯密碼長度問題
mysql> set global validate_password_policy=0;
mysql> set global validate_password_length=1;

mysql授權
授權用戶所有權限
grant all on . to '用戶'@"%" identified by "密碼";
grant alter,insert,select,delete,update,create,drop on . to '用戶'@"%" identified by "密碼";
FLUSH PRIVILEGES;

grant update,insert,select,create,DELETE on nad.* to 'svsadmin'@"%";

授權查詢權限
grant select on . to 用戶@"%" identified by "密碼";
撤銷drop權限
revoke drop on . from '用戶'@"%";

mysql查看用戶列表
mysql> select host,user from mysql.user;

查詢授權用戶權限
show grants for 用戶名;
刪除賬戶及權限
drop user 用戶名@'%';

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章