Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

MySQL Replication Between Major versions

Posted on 2009-07-01
5
Medium Priority
?
343 Views
Last Modified: 2012-05-07
Hello Experts,

I have a rather interesting problem (or at least it is interesting to me). I have a MySQL 4.1 server I am restricted to that version because it is required by our POS (point of sales) software. See i want to utilize triggers to aid in some integration with our website and email marketing company. Though the fact that triggers aren't available unless your using version 5.0 or newer sort of hurts things.

 Now that's what I'm wanting to do and here is what i've tired:

I figured for giggles i would just setup a master/slave replication between 4.1 and 5.0. Unfortunately the servers weren't replicating. I can only assume that they were because of a skip-name-resolve defined in the 4.1 server config file. Now the reason that is there is because the server was throwing a fit by the fact there is second network attach to the machine with no gateway it's just a cross over cable between it's self and it's network based raid 1 server for fail over.

So at this point i'm at a loss. on how i can achieve my end result. There are things i need to do instantly when a row is updated/inserted into certain tables with in our POS database. Anyone have ideas?
0
Comment
Question by:Pyromanci
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 33

Expert Comment

by:snoyes_jw
ID: 24756957
Replication is not instant, so don't rely on it if that's what you need. Replication requires a TCP connection.
0
 
LVL 5

Author Comment

by:Pyromanci
ID: 24757263
I know replication isn't instant, reason why I said it wasn't is the the fact i waited over a day and a single cell didn't replicate over (and yes i know how to set up replication I have it running for another project).

Let alone i am not even sure replication is what i need to do, because i have no clue if the triggers will remain if i added them in.

0
 
LVL 33

Expert Comment

by:snoyes_jw
ID: 24760340
The triggers will remain on the slave, and get fired, if you don't drop and recreate the tables on the master - those tables would get dropped and recreated without the triggers on the slave.

The bigger problem is the number of things that changed between the various versions - there are several statements that will cause syntax errors on the later version, even though they succeed on the earlier version (changes in reserved words, in the precedence of the comma operator and the JOIN keyword, handling of auto_increment values in INSERT...ON DUPLICATE KEY statements, to name a few).
0
 
LVL 5

Author Comment

by:Pyromanci
ID: 24762508
I know there would be some issues because the fact its a major version, but i just wasn't sure if this would be the ideal solution  for what i want to accomplish. Which is:
"There are things i need to do instantly when a row is updated/inserted into certain tables with in our POS database."

And even if it is not exactly that instant as long as it is with in 1-10minutes of it happening I can live with it.
0
 
LVL 5

Accepted Solution

by:
Pyromanci earned 0 total points
ID: 24809687
Well, I found the problem. The problem was the sub version compatibility. 4.1.18 does not properly replicate to the version of 5.0 i had installed (5.0.18). I upgraded my slave machine to 5.0.83 and it replicated with no problems and the triggers do function properly.

So i guess if anyone else is doing something similar make sure to 5.0.83 for your slave if coming form 4.1.
0

Featured Post

Tech or Treat!

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL several years ago, it seemed like now was a good time to update it for object-oriented PHP.  This article does that, replacing as much as possible the pr…
Containers like Docker and Rocket are getting more popular every day. In my conversations with customers, they consistently ask what containers are and how they can use them in their environment. If you’re as curious as most people, read on. . .
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question