n98-magerun icon indicating copy to clipboard operation
n98-magerun copied to clipboard

db:dump - Skip views/procedures

Open asalce opened this issue 10 years ago • 2 comments

Could we have an option to skip exports of Views/Procedures? I am trying to export a magento db which also has custom views and this is causing issues on import. I added the view names to the strip list but it seems like strip only works on real tables.

asalce avatar Jul 16 '14 19:07 asalce

I need further investigation to solve the issue. It seems that mysqldump which is used cannot distinguish between views and tables. So we need to detect it with PHP.

See: http://bugs.mysql.com/bug.php?id=16453

cmuench avatar Jul 27 '14 12:07 cmuench

This would be nice to have. I have the same issue as @asalce.

mysqldump: Couldn't execute 'show table status like 'v\_ea\_product\_summary'': SELECT command denied to user ''@'%' for column 'entity_id' in table 'catalog_product_flat_1' (1143)

v_ea_product_summary is a view.

danemacmillan avatar Jan 08 '15 20:01 danemacmillan

@danemacmillan @asalce In the meantime we added a logic which remove the definer from sql dump.

This is solved by piping the sql dump into this command: ' | LANG=C LC_CTYPE=C LC_ALL=C sed -E 's/DEFINER[ ]*=[ ]*[^]+@[^]+/DEFINER=CURRENT_USER/g'.

IMHO the issue should then be solved if your user is granted to create views which should be.

cmuench avatar Dec 16 '23 14:12 cmuench