我在我本地上已经可以用批处理进行备份了,但是同样的方法我在
服务器上运行的时候,windows命令行提示下面的内容,批处理一闪而过。
说明一下,服务器上装的是XAMPP集成的MYSQL
E:\web\xampp\mysql\bin>mysqldump -uroot -ppwd data_clean>d:\backup.
sql
mysqldump: Got error: 1356: View 'data_clean.performer_m3_check' references inva
lid table(s) or column(s) or function(s) or definer/invoker of view lack rights
to use them when using LOCK TABLES
不知道是什么原因?我要备份的数据库需要锁表吗?

解决方案 »

  1.   

    mysqldump -uroot -ppwd data_clean
    使用root权限理论上是最高了。你的数据库可能已经损坏了,(权限表损坏??)
    重新安装试试。
      

  2.   

    不是锁表问题,错误提示说明 你这个 'data_clean.performer_m3_check'  VIEW中引用了不存在的表或者列。在mysql看看 select * from data_clean.performer_m3_check; 看看这个VIEW是否则正常?
    如果正常, 再看一下 show create view data_clean.performer_m3_check; 看一下你的view 的select 代码。
      

  3.   

    1、有可能是MYSQL的BUG
    If a view is created and one of the underlying tables are subsequently dropped, LOCK
    tables will fail. This in turn causes mysqldump to fail dumping any tables from that same
    database. What is worse, mysqldump exits completely, meaning that any databases that would otherwise
    be dumped after the current one will not be. 
    2、有可能是权限的问题。