mysql5.6 mysqldump備份報錯

haoge0205發表於2018-10-10

mysqldump -uroot -p --single-transaction --databases A  B  C  D  E  F  G  H --master-data=2 > backup.sql


出現以下報錯:

mysqldump: Couldn't execute 'show table status like 'view\_frist\_order'': SELECT command denied to user ''@'localhost' for column 'usr_user_id' in table 'ord_order' (1143)



修改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'; 

再執行輸出的語句。


來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/28939273/viewspace-2215855/,如需轉載,請註明出處,否則將追究法律責任。

相關文章