Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6759433
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T13:56:24+00:00 2026-05-26T13:56:24+00:00

I have a slave database that bears a different name than it’s production counterpart.

  • 0

I have a slave database that bears a different name than it’s production counterpart. (We’ll call prod database and slave database_slave.)

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?

We are using replicate-rewrite-db option.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T13:56:25+00:00Added an answer on May 26, 2026 at 1:56 pm

    In case anybody comes searching for this, what I learned is that mysql views are built with the database name intact. Therefore when using the replicate-rewrite-db option to give the slave a different name, the views will NOT work correctly.

    The only way I’ve found to work around this is to avoid using the replicate-rewrite-db flag.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a master and slave database running on different nodes. The master DB
I have a backup server that replicates my production server's mysql database, awhile ago
I have a database that contains more than 100 million records. I am running
I have main table called 'Employee' and another slave table called 'EmployeeTypes' that has
I have a web-app that has a master mysql db and four slave dbs.
We have a database that has decompiled data versions of PDF files stored as
I have a database that stores an arbitrary number of phone numbers. There are
I have a database that accepts no null values and has a default for
I have a large MySQL database, lets call it live_db , which I want
We have a Rails application that is running in a MySQL master-slave set-up for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.