Re-assign host access permission to MySQL user

前端 未结 6 2318
情歌与酒
情歌与酒 2020-12-12 14:03

I have several thousand MySQL users all set to allow access from a specific host. The problem is that now I\'m going to have two machines (more in the future) which will nee

6条回答
  •  盖世英雄少女心
    2020-12-12 15:06

    For reference, the solution is:

    UPDATE mysql.user SET host = '10.0.0.%' WHERE host = 'internalfoo' AND user != 'root';
    UPDATE mysql.db SET host = '10.0.0.%' WHERE host = 'internalfoo' AND user != 'root';
    FLUSH PRIVILEGES;
    

提交回复
热议问题