MySql : Grant read only options?

后端 未结 7 571
南笙
南笙 2020-12-12 12:36

I have a user, whom I want to grant all the READ permission on a db schema.

One way is this :

GRANT SELECT, SHOW_VIEW  ON test.* TO \'readuser\'@\'%         


        
7条回答
  •  误落风尘
    2020-12-12 13:12

    Note for MySQL 8 it's different

    You need to do it in two steps:

    CREATE USER 'readonly_user'@'localhost' IDENTIFIED BY 'some_strong_password';
    GRANT SELECT, SHOW VIEW ON *.* TO 'readonly_user'@'localhost';
    flush privileges;
    

提交回复
热议问题