跳过或忽略Mysqldump中的定义器 [英] Skip or ignore definers in Mysqldump
本文介绍了跳过或忽略Mysqldump中的定义器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想知道是否可以阻止mysqldump插入此命令
I was wondering if I can prevent mysqldump inserting this commands
/*!50017 DEFINER=`root`@`localhost`*/
或者,例如,如果我以后必须使用sed来做
Or if I have to do it afterwards with sed, for example
谢谢!
推荐答案
自2006年以来,此问题就一直存在,没有任何修复迹象.
This issue has been around since 2006 with no sign of ever being fixed.
但是,在写转储文件之前,我已经通过grep(仅linux)通过管道将其修剪掉了一些定义行:
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.
这篇关于跳过或忽略Mysqldump中的定义器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文