Minimum GRANTs needed by mysqldump for dumping a full schema? (TRIGGERs are missing!!)

前端 未结 4 500
日久生厌
日久生厌 2020-12-02 08:15

I have a MySQL user called dump with the following perms:

GRANT USAGE ON *.* TO \'dump\'@\'%\' IDENTIFIED BY ...
GRANT SELECT, LOCK TABLES ON `mysql         


        
4条回答
  •  没有蜡笔的小新
    2020-12-02 08:41

    Assuming by full dump you also mean the VIEWs and the EVENTs, you would need:

    GRANT USAGE ON *.* TO 'dump'@'%' IDENTIFIED BY ...;
    GRANT SELECT, LOCK TABLES ON `mysql`.* TO 'dump'@'%';
    GRANT SELECT, LOCK TABLES, SHOW VIEW, EVENT, TRIGGER ON `myschema`.* TO 'dump'@'%';
    

    and if you have VIEWs that execute a function, then unfortunately you also need EXECUTE.

    My own problem is: why do I need SELECT if I only want to make a no-data dump?

提交回复
热议问题