How can I restrict a MySQL user to a particular tables

前端 未结 2 1694
迷失自我
迷失自我 2020-12-05 10:39

How can I restrict a user_account in MySQL database to a particular tables. Ex:

UserName: RestrictedUser
DatabaseName: db_Payroll 
TableName: 
  tb_Employee         


        
2条回答
  •  广开言路
    2020-12-05 11:27

    You can grant access to individual tables by running:

    GRANT ALL ON db_Payroll.tb_Users to RestrictedUser@RestrictedHostName;
    

    And similarly for other tables. Use a list of operations instead of ALL if appropriate.

    You cannot grant access to individual tables which do not exist yet without granting access to all tables.

提交回复
热议问题