关于数据库一些权限命令的总结

说到权限   首先要有数据库用户名 数据库的密码   主机   给大家一个表格参照一下

用户名密码主机
root1111localhost
root123410.10.65.253
xxxl000010.10.168.1.2

    那我们现创建一个用户吧

            CREATE  USER xxxl@localhost;

       创建用户并添加密码

            CREATE USER laobian@localhost identified by "123";

        创建用户允许远端登录  (三种方式)

            CREATE USER laobian@10.10.65.250 identified by "123";允许10.10.65.250以用户名laobian登录mysql

            CREATE USER laobian@10.10.65.% identified by "123";允许10.10.65.0~~~10.10.65.255以用户名laobian登录mysql

            CREATE USER laobian@10.10.65.25_ identified by "123";允许10.10.65.250~~~10.10.65.255以用户名laobian登录mysql

删除用户

             DROP USER liaobian@10.10.65.250

 

接下来说几个常用的权限   select   insert    update   create

        GRANT command ON database.table TO user@host

        Grant select on bian.person to laobian@localhost            将bian数据库的person表的查询权限授权给以localhost登录laobian用户

         Grant insert on bian.person to laobian@localhost            将bian数据库的person表的插入权限授权给以localhost登录老边用户

         Grant delete on bian.person to laobian@localhost           将bian数据库的person表的删除权限授权给以localhost登录laobian用户

         Grant update on bian.person to laobian@localhost          将bian数据库的person表的更新权限授权给以localhost登录laobian用户

         Grant select(id,name) on bian.person to laobian@localhost          将bian数据库的person表的id和name字段的查询权限授权给以localhost登录laobian用户

         Grant select ,insert,delete,update on bian.person to laobian@localhost           将bian数据库的person表的增删改查的查询权限授权给以localhost登录laobian用户

 

主外键关系

建模的两大任务

创建业务体系

创建主体之间的关系

业务主体之间的关系

          一对一        一会多         多对多

还有业务条件    

下一篇说一说几个不同之间的表的关联查询吧

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值