mysqldump: Got error: 1142: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'accounts' when using LOCK TABLES

本文涉及的产品
RDS MySQL DuckDB 分析主实例,基础系列 4核8GB
RDS AI 助手,专业版
RDS MySQL DuckDB 分析主实例,集群系列 4核8GB
简介:

AutoMySQLBackup备份时,出现mysqldump: Got error: 1142: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'accounts' when using LOCK TABLES错误,具体内容如下所示

[root@DB-Server ~]# /usr/bin/automysqlbackup /etc/automysqlbackup/myserver.conf

Parsed config file "/etc/automysqlbackup/automysqlbackup.conf"

# Checking for permissions to write to folders:

base folder /u03 ... exists ... ok.

backup folder /u03/mysqlbackup/ ... exists ... writable? yes. Proceeding.

checking directory "/u03/mysqlbackup//daily" ... exists.

checking directory "/u03/mysqlbackup//weekly" ... exists.

checking directory "/u03/mysqlbackup//monthly" ... exists.

checking directory "/u03/mysqlbackup//latest" ... exists.

checking directory "/u03/mysqlbackup//tmp" ... exists.

checking directory "/u03/mysqlbackup//fullschema" ... exists.

checking directory "/u03/mysqlbackup//status" ... exists.

# Testing for installed programs

WARNING: Turning off multicore support, since pigz isn't there.

mysql ... found.

mysqldump ... found.

# Parsing databases ... done.

======================================================================

AutoMySQLBackup version 3.0

http://sourceforge.net/projects/automysqlbackup/

Backup of Database Server - localhost

Databases - mysql,performance_schema,test

Databases (monthly) - mysql,performance_schema,test

======================================================================

======================================================================

Dump full schema.

Rotating 4 month backups for

======================================================================

======================================================================

Dump status.

Rotating 4 month backups for

======================================================================

Backup Start Time Sat Jul 11 22:12:31 CST 2015

======================================================================

Daily Backup ...

Daily Backup of Database ( mysql )

Rotating 6 day backups for mysql

----------------------------------------------------------------------

Daily Backup of Database ( performance_schema )

Rotating 6 day backups for performance_schema

----------------------------------------------------------------------

Daily Backup of Database ( test )

Rotating 6 day backups for test

----------------------------------------------------------------------

Backup End Time Sat Jul 11 22:12:31 CST 2015

======================================================================

Total disk space used for backup storage...

Size - Location

443k /u03/mysqlbackup/

======================================================================

###### WARNING ######

Errors reported during AutoMySQLBackup execution.. Backup failed

Error log below..

Warning: Using a password on the command line interface can be insecure.

Warning: Using a password on the command line interface can be insecure.

Warning: Using a password on the command line interface can be insecure.

Warning: Using a password on the command line interface can be insecure.

Warning: Using a password on the command line interface can be insecure.

mysqldump: Got error: 1142: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'accounts' when using LOCK TABLES

Warning: Using a password on the command line interface can be insecure.

du: WARNING: use --si, not -H; the meaning of the -H option will soon

change to be the same as that of --dereference-args (-D)

clip_image001

要解决这个错误只需要修改MySQLBackup的配置文件,将参数CONFIG_mysql_dump_single_transaction设为'yes'即可解决问题。网上关于这个错误的解决方法也有设置--skip-lock-tables的

相关实践学习
如何快速连接云数据库RDS MySQL
本场景介绍如何通过阿里云数据管理服务DMS快速连接云数据库RDS MySQL,然后进行数据表的CRUD操作。
MySQL数据库入门学习
本课程通过最流行的开源数据库MySQL带你了解数据库的世界。   相关的阿里云产品:云数据库RDS MySQL 版 阿里云关系型数据库RDS(Relational Database Service)是一种稳定可靠、可弹性伸缩的在线数据库服务,提供容灾、备份、恢复、迁移等方面的全套解决方案,彻底解决数据库运维的烦恼。 了解产品详情: https://www.aliyun.com/product/rds/mysql 
相关文章
|
Ubuntu 关系型数据库 MySQL
使用Ubuntu和Windows电脑实现Mysql主从同步(详细操作步骤)
使用Ubuntu和Windows电脑实现Mysql主从同步(详细操作步骤)
365 2
|
网络协议 关系型数据库 MySQL
mysql8.0远程连接权限设置
mysql8.0远程连接权限设置
622 0
|
Ubuntu
Ubuntu的中文乱码问题
Ubuntu的中文乱码问题
1184 2
|
域名解析 负载均衡 监控
阿里云DNS常见问题之使用DNS实现负载均衡失败如何解决
阿里云DNS(Domain Name System)服务是一个高可用和可扩展的云端DNS服务,用于将域名转换为IP地址,从而让用户能够通过域名访问云端资源。以下是一些关于阿里云DNS服务的常见问题合集:
|
前端开发
windows10 安装node npm 等前端环境 并配置国内源
windows10 安装node npm 等前端环境 并配置国内源
946 3
|
关系型数据库 MySQL Linux
Linux连接MySQL时的错误:Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock'
连接本地的MySQL数据库引擎时候出现的错误。用mysql_error()函数获取到错误提示:
|
11月前
|
SQL Oracle 关系型数据库
Oracle的cursor_sharing参数详解
总的来说,cursor_sharing参数是一个非常重要的参数,它可以影响Oracle数据库的性能和稳定性。因此,我们需要根据我们的应用程序的特性和需求,以及我们的性能和稳定性的需求,来选择最合适的值。
446 23
|
Prometheus 监控 Cloud Native
Prometheus 安全性与数据隐私
【8月更文第29天】Prometheus 是一个开源的监控系统,广泛应用于各种规模的企业中。随着 Prometheus 的普及,确保其安全性变得尤为重要。本文将详细探讨如何确保 Prometheus 服务器的安全性,包括认证、授权、加密通信等方面的措施,并提供相应的配置示例。
843 2
|
机器学习/深度学习 编解码 人工智能
rebuttal真的有用!这篇ICLR论文,所有审稿人都加了2分,直接跃升排名第9
SANA是一项基于线性扩散变换器的高效高分辨率图像合成框架,采用深度压缩自编码器和线性DiT模型,大幅提高图像合成效率与质量。引入解码器专用文本编码器提升图像与文本对齐能力,结合Flow-DPM-Solver优化训练和采样步骤。研究成果发表于ICLR会议,审稿评分显著提升。SANA生成速度快、模型小,适用于资源有限设备,但在某些方面仍有改进空间。论文地址:https://arxiv.org/abs/2410.10629
276 10