mysql更改用户权限

mysql更改用户权限

ID:34417825

大小:31.66 KB

页数:4页

时间:2019-03-05

mysql更改用户权限_第1页
mysql更改用户权限_第2页
mysql更改用户权限_第3页
mysql更改用户权限_第4页
资源描述:

《mysql更改用户权限》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库

1、mysql更改用户权限ThisentrywaspostedbyadminMonday,26April,20101.“grantallon*.*toroot@’%’identifiedby‘yourpassword’;”——这个还可以顺带设置密码。2.“flushprivileges;”——刷新一下,让权限生效。mysql的一些其他的管理,可以用mysqladmin命令。可以用来设置密码什么的。grant方面的详细信息可以看我下面的转载:本文实例,运行于MySQL5.0及以上版本。MySQL赋予用户权限命令的简单格式可概括为:grant权限on数据库对象to用户一、g

2、rant普通数据用户,查询、插入、更新、删除数据库中所有表数据的权利。grantselectontestdb.*tocommon_user@’%’grantinsertontestdb.*tocommon_user@’%’grantupdateontestdb.*tocommon_user@’%’grantdeleteontestdb.*tocommon_user@’%’或者,用一条MySQL命令来替代:grantselect,insert,update,deleteontestdb.*tocommon_user@’%’二、grant数据库开发人员,创建表、索引、视

3、图、存储过程、函数。。。等权限。grant创建、修改、删除MySQL数据表结构权限。grantcreateontestdb.*todeveloper@’192.168.0.%’;grantalterontestdb.*todeveloper@’192.168.0.%’;grantdrop  ontestdb.*todeveloper@’192.168.0.%’;grant操作MySQL外键权限。grantreferencesontestdb.*todeveloper@’192.168.0.%’;grant操作MySQL临时表权限。grantcreatetempora

4、rytablesontestdb.*todeveloper@’192.168.0.%’;grant操作MySQL索引权限。grantindexontestdb.*todeveloper@’192.168.0.%’;grant操作MySQL视图、查看视图源代码权限。grantcreateviewontestdb.*todeveloper@’192.168.0.%’;grantshow  viewontestdb.*todeveloper@’192.168.0.%’;grant操作MySQL存储过程、函数权限。grantcreateroutineontestdb.*to

5、developer@’192.168.0.%’;—now,canshowprocedurestatusgrantalterroutineontestdb.*todeveloper@’192.168.0.%’;—now,youcandropaproceduregrantexecute       ontestdb.*todeveloper@’192.168.0.%’;三、grant普通DBA管理某个MySQL数据库的权限。grantallprivilegesontestdbtodba@’localhost’其中,关键字“privileges”可以省略。四、grant高

6、级DBA管理MySQL中所有数据库的权限。grantallon*.*todba@’localhost’五、MySQLgrant权限,分别可以作用在多个层次上。1.grant作用在整个MySQL服务器上:grantselecton*.*todba@localhost;—dba可以查询MySQL中所有数据库中的表。grantall   on*.*todba@localhost;—dba可以管理MySQL中的所有数据库2.grant作用在单个数据库上:grantselectontestdb.*todba@localhost;—dba可以查询testdb中的表。3.gran

7、t作用在单个数据表上:grantselect,insert,update,deleteontestdb.orderstodba@localhost;4.grant作用在表中的列上:grantselect(id,se,rank)ontestdb.apache_logtodba@localhost;5.grant作用在存储过程、函数上:grantexecuteonproceduretestdb.pr_addto‘dba’@'localhost’grantexecuteonfunctiontestdb.fn_addto‘dba’@'localhost’六、查看MySQ

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。