mysql-mysqldump-报错

Mysql-mysqldump-报错

版本

1
2
mysql 5.7.31+
mysql 8.0.21+

报错

1
mysqldump: Error: 'Access denied; you need (at least one of) the PROCESS privilege(s) for this operation' when trying to dump tablespaces

错误分析

1
2
3
4
5
6
7
8
The last PROCESS privilege is new as of MySQL 5.7.31 and MySQL 8.0.21 and may be the 
root source of your problem. You can solve the mysqldump process privilege error in
two ways:

1.Updating the privileges for your database user.
赋权
2.Runing mysqldump with the --no-tablespaces option.
加上--no-tablespaces选项

解决办法

1
2
3
GRANT PROCESS ON *.* TO user@localhost;
## or
mysqldump -u abc db1 -p -C --no-tablespaces |gzip > db1.sql.gz