最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
mysql创建各种权限用户的命令
时间:2022-11-14 23:36:58 编辑:袖梨 来源:一聚教程网
用命令创建各种权限的mysql帐号的方法如下(一定要先进入mysql,在mysql命令下执行以下的语句):
1. 创建一个用户,并拥有创建数据库,修改字段,删除表,对表增删改查的权限,和支持远程甚至任何地方登陆的权限(差不多相当于root帐号的权限):
grant select,insert,update,delete,create,drop,alter on *.* to reson1@"%" identified by "123456";
grant select,insert,update,delete,create,drop,alter on *.* to reson1@localhost identified by
"123456"; (一定要添加一条"%"和一条localhost,这样才能既支持本地访问,又支持远程任一ip访问。其中reson1为用户名,123456为密码)
2. 创建一个用户,并拥有对表增删改查的权限,只能在本地登陆:
grant select,insert,update,delete on *.* to reson2@localhost identified by "123456";
3. 创建一个用户,并拥有对表增删改查的权限,只能在192.168.1.100登陆,且只能操作dat1数据库的权限:
grant select,insert,update,delete on dat1.* to [email protected] identified by "123456";
掌握以上3个案例,就能创建各种想要的权限的mysql帐号了。
相关文章
- 《暖雪》终业DLC新流派灵剑修罗开荒有哪些 06-16
- Metaplanet 砸 1.17 亿美元加码比特币!持币量突破 1 万枚、超越 Coinbase 06-16
- 《魔力宝贝:复兴》1~30级主线困难有哪些快速通关方法 06-16
- 《欢乐钓鱼大师》稀有鱼垂钓有哪些方法 06-16
- SNORT币手续费低吗?2025币安交易所低成本教程 06-16
- 《潜水员戴夫》圆翅燕鱼抓捕怎样 06-16