3

I know you're not supposed to do this, but I have a MySQL 5.5 master and a MySQL 5.1 replication slave. That's supposed to be okay, unless I do something stupid like use utf8mb4 that isn't supported by 5.1. Well, everything has been going well for a while and today I got a replication slave failure because character_set_client #45 isn't supported by MySQL 5.1.

I spent a lot of time trying to find out what #45 was... you see, it doesn't appear in any of MySQL's configuration files -- even on 5.5. I finally determined it was utf8mb4 (which I had suspected) but I'm not sure why it's being used. I performed a static query on the master ... something simple like UPDATE table SET field='value' and it replicated to the slave by setting the character set to utf8mb4. I executed hundreds of similar UPDATE statements at the same time, but some of them triggered the use of utf8mb4.

So... I'm going to be upgrading my slave to 5.5, but in the mean time is there a way to tell MySQL to never use utf8mb4?

0

1 Answer 1

3

POLITICALLY CORRECT ANSWER

You cannot do MySQL Replication from a New Master to an Old Slave

I have written many posts about this:

In addition, there is the likelihood of dealing with the internal BINLOG magic number being in the wrong place and replication going senile. Here are my posts on the BINLOG magic number:

Since there is nothing in the meantime you can do, please upgrade your Slave to MySQL 5.5

ALTERNATE PERSPECTIVE

In all fairness, @ChristopherSchultz is correct in that you can implement it. I just yell and scream "RISK !!!" to be more cautious because of the BINLOG magic number's place in the MySQL Replication Universe.

6
  • Just checking: you mean that it's ''inadvisable'' to fo MySQL replication from a newer-versioned master to an older-versioned slave, right? Your other posts seem to indicate that it is not even possible, yet my experience is that it works fine until something odd like this (utf8mb4 is missing on slave) happens. Feb 12, 2013 at 19:46
  • Binlogs start at different places in different versions and can possibly get mangled on rotation (binary logs and relay logs alike). The binary log magic number is also shifted: dba.stackexchange.com/a/27756/877 Feb 12, 2013 at 19:49
  • There are many caveats to attempt such replication. From my past experiences, the best solution is upgrading : dev.mysql.com/doc/refman/5.5/en/replication-compatibility.html Feb 12, 2013 at 19:52
  • To be politically correct, yes it is inadvisable. Sorry if my answer is rather paranoid. Upgrading takes away all the what-ifs and I-should-have-dones. Feb 12, 2013 at 19:54
  • Definitely: upgrading is the best course. It just sounded like you were saying there was a technical reason the two couldn't be set up for replication. The reality is that it works, but there are definite risks that can and -- in my case -- will cause problems. Feb 12, 2013 at 20:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.