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 用戶;

發佈了71 篇原創文章 · 獲贊 21 · 訪問量 2萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章