mysql-權限管理
阿新 • • 發佈:2017-06-09
查詢 code zhang ngs pan option mysql- pre 所有
查詢用戶: select User from user; 授權權限: 授予指定權限: grant insert,select on *.* to ‘user_name‘@‘localhost‘ with grant option; (*.*的意思:如:A.B => 數據庫A中的表B) 授予所有權限: grant all privileges on *.* to ‘user_name‘@‘localhost‘ with grant option; 查看權限: show grants for ‘user_name‘@‘localhost‘; 查看當前用戶的權限:show grants; 回收權限: 回收指定權限: revoke insert,select,grant option on *.* from ‘user_name‘@‘localhost‘ ...; 回收所有權限: revoke all privileges,grant option from ‘user‘@‘localhost‘ ...; grant insert,select on *.* to ‘zhangsan‘@‘localhost‘ with grantoption; show grants for ‘zhangsan‘@‘localhost‘;
mysql-權限管理