I have a slave database that bears a different name than it's production counterpart. (We are using the replicate-rewrite-db
option.)
When I run a mysqldump from the slave (which I do for making dev copies), two of the database views have the database name attached to them. I cannot use the dump file to create another copy without manually editing it.
If I run the same mysqldump from the production copy, everything comes out clean. So for some reason the slave has created these two views incorrectly. (The other four views were created before replication was established, which I believe explains the difference. I have confirmed replication is in sync.)
Snippet of the mysqldump from the slave:
/*!50001 VIEW `database_slave`.`view_company` AS select `database`.`company`.`id` AS `id`,
`database`.`company`.`name` AS `name`,`database`.`company`.`state` AS `state`,
Same snippet of the mysqldump, but from production (nice and clean):
/*!50001 VIEW `view_company` AS select `company`.`id` AS `id`,
`company`.`name` AS `name`,`company`.`state` AS `state`,
Can I fix this without having to dump from prod to the slave?