執行:[root@host2 lamp]# mysqldump -F -R -E --master-data=2 -p -A --single-transaction
在控制台端出現
mysqldump: Couldn't execute 'show table status like 'v\_bid\_bad'': SELECT command denied to user ''@'%' for column 'id' in table 't_bids' (1143)
在workbench進行select * from v_bid_bad 出現:
10:29:20 SELECT * FROM sp.v_bid_bad LIMIT 0, 50000 Error Code: 1449. The user specified as a definer ('root'@'%') does not exist 0.000 sec
屬於權限問題
修改方法有兩種:
1. 增加root@%帳戶和權限
grant all on *.* to 'root'@'%' identified by '00000';
2.修改view的definer
一般如是是在本機的話用:
select concat("alter DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW ",TABLE_SCHEMA,".",TABLE_NAME," as ",VIEW_DEFINITION,";") from information_schema.VIEWS whereTABLE_SCHEMA='sp';
再執行輸出的語句。
成功解決此問題.