mysqldump远程备份错误及处理办法汇总


1044错误

在备份一个远程数据库时遇到下面的错误,由于没有操作那台机器的权限,当然也没有root账号。

mysqldump: Got error: 1044 Access denied for user  ****  when using LOCK TABLES

发现可以通过添加额外的参数来处理–single-transaction或者–skip-lock-tables,任选其一即可。

mysqldump -udbuser -p -hremote_host --single-transaction  dbname> db-back-20161026-s.sql

1356错误

mysqldump: Couldn’t execute ‘SHOW FIELDS FROM `some_database`’: View ‘some_database.viewname’ references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them (1356)

解决办法添加参数即可解决

--ignore-table=some_database.viewname

1194错误

mysqldump:error 1194:table ‘some_table’ is marked as crashed and should be repaired when dumping table ‘some_table’ at row:164463

登录mysql执行

repair table `some_table`
普人特福的博客cnzz&51la for wordpress,cnzz for wordpress,51la for wordpress