学习 MySQL-DBA常用SQL汇总

创建用户


GRANT USAGE ON *.* TO 'rp'@'%' IDENTIFIED BY 'rp'
WITH MAX_QUERIES_PER_HOUR 0
MAX_UPDATES_PER_HOUR 0
MAX_CONNECTIONS_PER_HOUR 0;

解释:创建的用户是rp@%,密码是rp。

给用户授权


 GRANT Create Routine, Insert, Lock Tables, References, Select, Drop, Delete, Index, Alter Routine, Create View, Create Temporary Tables, Show View, Trigger,Event, Create, Update, Execute, Grant Option, Alter ON `rp`.* TO `rp`@`%`;

解释:给用户rp@% 对数据库rp的操作权限,这里全部的操作权限都授权了。

posted @ 2015-01-14 10:27  辵鵵  阅读(399)  评论(0编辑  收藏  举报