mysqldump error – view lack rights to use them (1356)

If you get an error messages like “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)” you can work around this by trying the dump as “root” or telling mysqldump to ignore the broken view by adding this option to your mysqldump command

--ignore-table=some_database.viewname

(You’d think there would be an –ignore-view option wouldn’t you?)

Then you can ask your DBA to check and sort the broken view, you can get a dump of the view with:

SELECT VIEW_DEFINITION FROM INFORMATION_SCHEMA.VIEWS WHERE TABLE_NAME = 'viewname' AND TABLE_SCHEMA = 'some_database';

Comments are closed, but trackbacks and pingbacks are open.