MySQL Views#1356 - View 'pimcore.object_5' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them

I had issues taking a copy of Pimcore database and import it to another instance having another MySQL user. The reason for this was in the definition of the MySQL View, since it declares the definer and that makes it impossible for the user used for the other instance of Pimcore to read from the View.

Solution:
You have to edit the SQL export file before you import it and replace all original MySQL users with the new one:  ...DEFINER=`pimcore`@`%` SQL...

DROP TABLE IF EXISTS `object_8`;

CREATE ALGORITHM=UNDEFINED DEFINER=`pimcore`@`%` SQL SECURITY DEFINER VIEW `object_8` AS select `object_query_8`.`oo_id` AS `oo_id`,`object_query_8`.`oo_classId` AS `oo_classId`,`object_query_8`.`oo_className` AS `oo_className`,`object_query_8`.`title` AS `title`,`object_query_8`.`area_id` AS `area_id`,`object_query_8`.`href__id` AS `href__id`,`object_query_8`.`href__type` AS `href__type`,`object_query_8`.`link` AS `link`,`object_query_8`.`matrix_id` AS `matrix_id`,`object_query_8`.`country_code` AS `country_code`,`object_query_8`.`linkTarget` AS `linkTarget`,`object_query_8`.`priority` AS `priority`,`object_query_8`.`segment_id` AS `segment_id`,`object_query_8`.`package_id` AS `package_id`,`object_query_8`.`matrix_sub_id` AS `matrix_sub_id`,`object_query_8`.`area_sub_id` AS `area_sub_id`,`object_query_8`.`primary_lang` AS `primary_lang`,`objects`.`o_id` AS `o_id`,`objects`.`o_parentId` AS `o_parentId`,`objects`.`o_type` AS `o_type`,`objects`.`o_key` AS `o_key`,`objects`.`o_path` AS `o_path`,`objects`.`o_index` AS `o_index`,`objects`.`o_published` AS `o_published`,`objects`.`o_creationDate` AS `o_creationDate`,`objects`.`o_modificationDate` AS `o_modificationDate`,`objects`.`o_userOwner` AS `o_userOwner`,`objects`.`o_userModification` AS `o_userModification`,`objects`.`o_classId` AS `o_classId`,`objects`.`o_className` AS `o_className` from (`object_query_8` join `objects` on((`objects`.`o_id` = `object_query_8`.`oo_id`)));
Knowledge keywords: