Revoke all privileges for all users on a MySQL DB

前端 未结 4 687
无人共我
无人共我 2020-12-15 06:29

From: http://dev.mysql.com/doc/refman/5.0/en/drop-database.html

...when a database is dropped, user privileges on the database are not automatically d

4条回答
  •  独厮守ぢ
    2020-12-15 07:33

    REVOKE ALL PRIVILEGES FROM '%'@'%';
    

    The above could be dangerous as i suppose it will delete all the privileges from all the users including root

    Modify it to:

    REVOKE ALL PRIVILEGES FROM 'user'@'localhost';
    

    or

    REVOKE ALL PRIVILEGES FROM 'user'@'%';
    

    before execute

提交回复
热议问题