mysqldump 所需要的权限说明:
1、对于table 来说mysqldump 最少要有select 权限。
2、对于view 来说mysqldump 要有show view 权限。
3、对于trrigger 来说mysqldump 要有trriger 权限。
4、如果要产生一份一致的备份 mysqldump 要有lock tables 权限。
mysql> create user [email protected]‘%‘; Query OK, 0 rows affected (0.00 sec) mysql> grant select on *.* to [email protected]‘%‘; Query OK, 0 rows affected (0.00 sec) mysql> grant show view on *.* to [email protected]‘%‘; Query OK, 0 rows affected (0.00 sec) mysql> grant lock tables on *.* to [email protected]‘%‘; Query OK, 0 rows affected (0.00 sec) mysql> grant trigger on *.* to [email protected]‘%‘; Query OK, 0 rows affected (0.00 sec)
给用户设密码:
mysql> update user set password=password(‘test-db‘) where user=‘dumper‘;
时间: 2024-10-14 18:09:52