码迷,mamicode.com
首页 > 数据库 > 详细

mysql_4

时间:2017-07-17 17:09:24      阅读:180      评论:0      收藏:0      [点我收藏+]

标签:lte   mysql   password   db_name   添加   ons   name   option   ges   

----------------------------------------------------------------------------------------------------------
--添加用户
create user user [identified by [password] password]
    [, user [identified by [password] password]] ...
user:
    user_name@ host name
--删除用户
drop user user [, user_name] ...
--修改用户名
rename user old_user to new_user,
    [, old_user to new_user] ...
--修改密码
SET  PASSWORD [FOR user]= PASSWORD(newpassword)
-------------------------------------------------------------------------------------------------------------
--grant语法格式
grant  priv_type [(column_list)] [, priv_type [(column_list)]] ...
    on [object_type] {tbl_name | * | *.* | db_name.*}
    to user [identified by [password] password]
        [, user [identified by [password] password]] ...
    [with with_option [with_option] ...]
priv_type:
    insert,selectupdatedeletereferencescreatealterindexdrop、all或all privileges(表)
    SELECTINSERTDELETEUPDATEREFERENCESCREATEALTERINDEXDROPCREATE TEMPORARY TABLES、CREATE VIEW、SHOW VIEWCREATE ROUTINE、ALTER ROUTINE、EXECUTE ROUTINE、LOCK TABLES、ALL或ALL PRIVILEGES
object_type:
    table
    | function
    | procedure
with_option :--表示TO子句中指定的所有用户都有把自己所拥有的权限授予其他用户的权利,而不管其他用户是否拥有该权限。
      grant option
    | max_queries_per_hour count
    | max_updates_per_hour count
    | max_connections_per_hour count
    | max_user_connections count
--回收权限
revoke priv_type [(column_list)] [, priv_type [(column_list)]] ...
    on  {tbl_name | * | *.* | db_name.*}
    from user [, user] ...
--或者:
revoke all privileges, grant option from user [, user] ...
-----------------------------------------------------------------------------------

 

mysql_4

标签:lte   mysql   password   db_name   添加   ons   name   option   ges   

原文地址:http://www.cnblogs.com/wangyonglong/p/7196030.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!