使用mysqldump对mysql进行数据库备份的时候可能遇到Using a password on the command line interface can be insecure,问题原因是从mysql5.6版本不再建议将密码写在命令行中,而是使用文件,报错详情如下:
mysqldump: [Warning] Using a password on the command line interface can be insecure.
mysqldump: Error: 'Access denied; you need (at least one of) the PROCESS privilege(s) for this operation' when trying to dump tablespaces本文地址:http://www.04007.cn/article/1049.html,未经许可,不得转载.
之前有篇文章涉及此:http://www.04007.cn/article/722.html 解决方法就是将账号密码写在vim /etc/mysql/my.cnf文件中,然后直接mysqldump不需要输入账号密码,更方便。本文地址:http://www.04007.cn/article/1049.html,未经许可,不得转载.
第二个问题:mysqldump: Error: 'Access denied; you need (at least one of) the PROCESS privilege(s) for this operation' when trying to dump tablespaces。这里涉及到新版本的MYSQL增加了一个PROCESS privilege权限,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.更新账户权限添加process privileges。
2.运行mysqldump时带上--no-tablespaces option.本文地址:http://www.04007.cn/article/1049.html,未经许可,不得转载.
发现有一点:The mysqldump command requires at least the following privilege assigned to the user:
SELECT privilege for dumped tables
SHOW VIEW for dumped views
TRIGGER for dumped triggers
LOCK TABLES if you don’t use the --single-transaction option
PROCESS if you don’t use the --no-tablespaces option
第四行,如果在选项中未带上--single-transaction选项,在执行命令的时候将会进行锁表。所以执行导出时最好同时带上--no-tablespaces和--single-transaction选项本文地址:http://www.04007.cn/article/1049.html,未经许可,不得转载.
本文地址:http://www.04007.cn/article/1049.html 未经许可,不得转载. 手机访问本页请扫描右下方二维码.
![]() |
![]() |
手机扫码直接打开本页面 |