Mysqldump without "CREATE ALGORITHM" and "DEFINER"

In my backup and export of the database, I get the following:

/*!50001 DROP TABLE `vTime`*/; /*!50001 DROP VIEW IF EXISTS `vTime`*/; /*!50001 CREATE ALGORITHM=UNDEFINED */ /*!50013 DEFINER=`db_user`@`%` SQL SECURITY DEFINER */ /*!50001 VIEW `vTime` AS select ... */; 
  • This causes problems when recovering from the failure of the "CREATE ALGORITHM" and "DEFINER" parts when trying to restore. Is there a way to do mysqldump instead of just CREATE VIEW ?

  • Bonus question: what do the parts of /*!50001 mean?

EDIT: I have to add that this is the error I get:

#1227 - Access denied; you need (at least one of) the SUPER privilege(s) for this operation

EDIT 2: It seems that only part of /*!50013 DEFINER= does not work.

+5
source share
1 answer

Part/*! 50001 is the version number.

The question has already been given here: MySQL flags in dumps

The main problem of removing DEFINER is best done with a script. Some examples are already available on the Internet:

https://dbperf.wordpress.com/2010/04/12/removing-definer-from-mysql-dump/

Remove DEFINER clause from MySQL Dumps

+2
source

Source: https://habr.com/ru/post/1202927/


All Articles