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

  • SEARCH
  • Home
  • 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 48563
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T16:17:59+00:00 2026-05-10T16:17:59+00:00

I am running a couple of databases on MySQL 5.0.45 and am trying to

  • 0

I am running a couple of databases on MySQL 5.0.45 and am trying to get my legacy database to sync with a revised schema, so I can run both side by side. I am doing this by adding triggers to the new database but I am running into problems with replication. My set up is as follows.

Server ‘master’

  • Database ‘legacydb’, replicates to server ‘slave’.
  • Database ‘newdb’, has triggers which update ‘legacydb’ and no replication.

Server ‘slave’

  • Database ‘legacydb’

My updates to ‘newdb’ run fine, and set off my triggers. They update ‘legacydb’ on ‘master’ server. However, the changes are not replicated down to the slaves. The MySQL docs say that for simplicity replication looks at the current database context (e.g. 'SELECT DATABASE();' ) when deciding which queries to replicate rather than looking at the product of the query. My trigger is run from the context of database ‘newdb’, so replication ignores the updates.

I have tried moving the update statement to a stored procedure in ‘legacydb’. This works fine (i.e. data replicates to slave) when I connect to ‘master’ and manually run 'USE newdb; CALL legacydb.do_update('Foobar', 1, 2, 3, 4);'. However, when this procedure is called from a trigger it does not replicate.

So far my thinking on how to fix this has been one of the following.

  • Force the trigger to set a new current database. This would be easiest, but I don’t think this is possible. This is what I hoped to achieve with the stored procedure.

  • Replicate both databases, and have triggers in both master and slave. This would be possible, but a pain to set up.

  • Force the replication to pick up all changes to ‘legacydb’, regardless of the current database context.

  • If replication runs at too high a level, it will never even see any updates run by my trigger, in which case no amount of hacking is going to achieve what I want.

Any help on how to achieve this would be greatly appreciated.

  • 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. 2026-05-10T16:17:59+00:00Added an answer on May 10, 2026 at 4:17 pm

    This may have something to do with it:

    A stored function acquires table locks before executing, to avoid inconsistency in the binary log due to mismatch of the order in which statements execute and when they appear in the log. Statements that invoke a function are recorded rather than the statements executed within the function. Consequently, stored functions that update the same underlying tables do not execute in parallel.

    In contrast, stored procedures do not acquire table-level locks. All statements executed within stored procedures are written to the binary log.

    Additionally, there are a whole list of issues with Triggers: http://dev.mysql.com/doc/refman/5.0/en/routine-restrictions.html

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

Sidebar

Ask A Question

Stats

  • Questions 59k
  • Answers 59k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer I know this is only a workaround, but you can… May 11, 2026 at 9:00 am
  • added an answer Scott Gu had an article on this once. The solution… May 11, 2026 at 9:00 am
  • added an answer There are a number of JavaScript plugins for doing this:… May 11, 2026 at 9:00 am

Related Questions

I am running a couple of databases on MySQL 5.0.45 and am trying to
I am running a Tomcat application, and I need to display some time values.
I am running a mysql server. I would like to somehow make sure that
I am running a java program that sets up a database connection to an
I am running a Solr instance on Jetty and when I search using the
I am running a program and want to see what its return code is
I am running a windows machine have installed Python 2.5. I also used the
I am running a Visual Studio Load Test using an Agent on one of
I am running a SVN server on my Windows Server and want to schedule
I am running a query against a providex database that we use in MAS

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.