Skip or ignore definers in Mysqldump

情到浓时终转凉″ 提交于 2020-01-01 09:37:29

问题


I was wondering if I can prevent mysqldump inserting this commands

/*!50017 DEFINER=`root`@`localhost`*/

Or if I have to do it afterwards with sed, for example

Thanks!


回答1:


This issue has been around since 2006 with no sign of ever being fixed.

I have, however, piped it through grep (linux only) to trim out the definer lines before writing the dump file:

mysqldump -u dbuser -p dbname | grep -v 'SQL SECURITY DEFINER' > dump.sql

A bit of a mouthful (or keyboardful?) but I think it's the only way.



来源:https://stackoverflow.com/questions/11901344/skip-or-ignore-definers-in-mysqldump

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!