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

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

用户名 密码 主机
root 1111 localhost
root 1234 10.10.65.253
xxxl 0000 10.10.168.1.2

    那我们现创建一个用户吧

            CREATE  USER xxxl@localhost;

       创建用户并添加密码

            CREATE USER laobian@localhost identified by "123";

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

            CREATE USER [email protected] identified by "123";允许10.10.65.250以用户名laobian登录mysql

            CREATE USER [email protected].% identified by "123";允许10.10.65.0~~~10.10.65.255以用户名laobian登录mysql

            CREATE USER [email protected]_ identified by "123";允许10.10.65.250~~~10.10.65.255以用户名laobian登录mysql

删除用户

             DROP USER [email protected]

接下来说几个常用的权限   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用户

主外键关系

建模的两大任务

创建业务体系

创建主体之间的关系

业务主体之间的关系

          一对一        一会多         多对多

还有业务条件    

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

猜你喜欢

转载自blog.csdn.net/weixin_44303465/article/details/88581872
今日推荐