1. 程式人生 > >mysqldump 備份數據庫用戶所需要的權限

mysqldump 備份數據庫用戶所需要的權限

fec show update mysqldump highlight blog ger sql 0 rows

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‘;

mysqldump 備份數據庫用戶所需要的權限