问题描述:

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!

网友答案:

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.

相关阅读:
Top