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


    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的。

  • 相关阅读:
    LLC半桥谐振变换器调试记录
    工业派学习记录
    ubuntu 命令记录
    电容单位换算
    Windows快捷键
    CAN总线学习笔记
    Scala 基础(十五):Scala 模式匹配(三)
    Scala 基础(十四):Scala 模式匹配(二)
    Scala 基础(十三):Scala 模式匹配(一)
    scala 数据结构(十一):流 Stream、视图 View、线程安全的集合、并行集合
  • 原文地址:https://www.cnblogs.com/kerrycode/p/4639590.html
Copyright © 2020-2023  润新知