From Is externallinks not available for the English Wikipedia?:
I was hoping to do a query to find Flickr images on enwiki (these need to be moved to Commons). I get an error. Thanks.
View 'enwiki_p.externallinks' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them