mysql----用户、权限


权限:限制用户能够进行的数据库的操作。
    create drop alter update delete insert select 
    create view:创建视图
    index:索引权限
    execute:执行存储过程的权限
    
用户:
    创建用户:create user 'usr_name'@'localhost' indentified by '密码';
            刚创建的用户没有使用数据库的权限。
    删除用户:drop user 'user_name'@'localhost';
    分配用户权限:with grant option代表这个用户具备给其他用户分配权限的权限;
        grant 权限(列名)on 数据库对象 to 用户 indentified by '密码' with grant option;
     如:grant all privileges on *.* to 用户 indentified by '密码';
        flush privileges;
        grant insert,update,select,delete on db.table to 用户 indentified by '密码';
    查看用户权限:
        show grants;
        show grants for 'user_name'@'localhost';
    删除权限:
        revoke 权限 on 数据库对象 from 用户;

发布了76 篇原创文章 · 获赞 21 · 访问量 2万+

猜你喜欢

转载自blog.csdn.net/shen_chengfeng/article/details/103753275