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

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

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

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

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

查詢受權用戶權限
show grants for 用戶名;
刪除帳戶及權限
drop user 用戶名@'%';io

相關文章
相關標籤/搜索