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

本文涉及的产品
云数据库 RDS MySQL,集群系列 2核4GB
推荐场景:
搭建个人博客
RDS MySQL Serverless 基础系列,0.5-2RCU 50GB
云数据库 RDS MySQL,高可用系列 2核4GB
简介:

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的

相关实践学习
如何在云端创建MySQL数据库
开始实验后,系统会自动创建一台自建MySQL的 源数据库 ECS 实例和一台 目标数据库 RDS。
全面了解阿里云能为你做什么
阿里云在全球各地部署高效节能的绿色数据中心,利用清洁计算为万物互联的新世界提供源源不断的能源动力,目前开服的区域包括中国(华北、华东、华南、香港)、新加坡、美国(美东、美西)、欧洲、中东、澳大利亚、日本。目前阿里云的产品涵盖弹性计算、数据库、存储与CDN、分析与搜索、云通信、网络、管理与监控、应用服务、互联网中间件、移动服务、视频服务等。通过本课程,来了解阿里云能够为你的业务带来哪些帮助     相关的阿里云产品:云服务器ECS 云服务器 ECS(Elastic Compute Service)是一种弹性可伸缩的计算服务,助您降低 IT 成本,提升运维效率,使您更专注于核心业务创新。产品详情: https://www.aliyun.com/product/ecs
相关文章
|
6月前
|
存储 索引
mysqldump got error 1812 tablespace is missing for table when using lock tables
mysqldump got error 1812 tablespace is missing for table when using lock tables
245 1
|
关系型数据库 MySQL
深入理解SELECT ... LOCK IN SHARE MODE和SELECT ... FOR UPDATE
深入理解SELECT ... LOCK IN SHARE MODE和SELECT ... FOR UPDATE
|
SQL 关系型数据库 MySQL
mysql Error Code: 1175. You are using safe update mode and you tried to update a table without ....
mysql Error Code: 1175. You are using safe update mode and you tried to update a table without ....
215 0
mysql Error Code: 1175. You are using safe update mode and you tried to update a table without ....
|
关系型数据库 MySQL 数据库
[Err] 1143 - SELECT command denied to user 'XX'@'%' for column 'XXX' in table 'XX'
[Err] 1143 - SELECT command denied to user 'XX'@'%' for column 'XXX' in table 'XX'
281 0
[Err] 1143 - SELECT command denied to user 'XX'@'%' for column 'XXX' in table 'XX'
|
SQL Oracle 关系型数据库
1120 11g select for update skip locked
[20171120]11g select for update skip locked.txt --//11G在select for update遇到阻塞时可以通过skipped locked跳过阻塞的记录,测试看看: 1.
1276 0
下一篇
无影云桌面