Home Database Mysql Tutorial Character set '#45' 导致主从停止问题

Character set '#45' 导致主从停止问题

Jun 07, 2016 pm 05:58 PM
character set stop lead to question

今天有同学在搭建主从环境的时候发现一个问题,简单说明一下。感谢 @年代80s. 现象: 从库上Slave_IO_Running停止,Last_Error显示如下: bin/mysqlbinlog: Character set #45 is not a compiled character set and is not specified in the /u01/dingqi.lxb/

今天有同学在搭建主从环境的时候发现一个问题,简单说明一下。感谢 @年代80s.

现象:

从库上Slave_IO_Running停止,Last_Error显示如下:

bin/mysqlbinlog: Character set ‘#45′ is not a compiled character set and is not specified in the ‘/u01/dingqi.lxb/transfer2/master/share/mysql/charsets/Index.xml’ file
-


分析:

此时用mysqlbinlog 执行对应的relaylog文件,也会出现上面这个错误提示。

查看这个提示位置的Index.xml,这里记录了这个server提供的所有字符集。我们发现,其实没有id为45的字符集。

也就是这个原因,导致slave在同步时,解析出错,导致同步停止。

SET @@session.character_set_client=45,@@session.collation_connection=45,@@session.collation_server=33

从这个命令中看,是有用户连接进master以后,执行了一个set names xxx (xxx是某个字符集名字),而这个xxx被翻译成45.



复现:

我们要找出编号45的字符集。在5.5上执行如下命令:

发现原来是这个叫做utf8mb4的字符集,这个字符集在5.1里面是还没有的。

解决:

给我们的提示就是在高版本对低版本的主从中,要注意不要用到低版本不支持的字符集(所以官方并不建议高版本的master同步到低版本的slave)。

对于已经在Master的里面已经存在的binlog,要让主从能够继续同步,只能在slave_skip_errors里加上 22这个错误号.
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
1 months ago By 尊渡假赌尊渡假赌尊渡假赌
Two Point Museum: All Exhibits And Where To Find Them
1 months ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Detailed explanation of the Set tag function in MyBatis dynamic SQL tags Detailed explanation of the Set tag function in MyBatis dynamic SQL tags Feb 26, 2024 pm 07:48 PM

Interpretation of MyBatis dynamic SQL tags: Detailed explanation of Set tag usage MyBatis is an excellent persistence layer framework. It provides a wealth of dynamic SQL tags and can flexibly construct database operation statements. Among them, the Set tag is used to generate the SET clause in the UPDATE statement, which is very commonly used in update operations. This article will explain in detail the usage of the Set tag in MyBatis and demonstrate its functionality through specific code examples. What is Set tag Set tag is used in MyBati

How to solve the problem that jQuery cannot obtain the form element value How to solve the problem that jQuery cannot obtain the form element value Feb 19, 2024 pm 02:01 PM

To solve the problem that jQuery.val() cannot be used, specific code examples are required. For front-end developers, using jQuery is one of the common operations. Among them, using the .val() method to get or set the value of a form element is a very common operation. However, in some specific cases, the problem of not being able to use the .val() method may arise. This article will introduce some common situations and solutions, and provide specific code examples. Problem Description When using jQuery to develop front-end pages, sometimes you will encounter

Clustering effect evaluation problem in clustering algorithm Clustering effect evaluation problem in clustering algorithm Oct 10, 2023 pm 01:12 PM

The clustering effect evaluation problem in the clustering algorithm requires specific code examples. Clustering is an unsupervised learning method that groups similar samples into one category by clustering data. In clustering algorithms, how to evaluate the effect of clustering is an important issue. This article will introduce several commonly used clustering effect evaluation indicators and give corresponding code examples. 1. Clustering effect evaluation index Silhouette Coefficient Silhouette coefficient evaluates the clustering effect by calculating the closeness of the sample and the degree of separation from other clusters.

Teach you how to diagnose common iPhone problems Teach you how to diagnose common iPhone problems Dec 03, 2023 am 08:15 AM

Known for its powerful performance and versatile features, the iPhone is not immune to the occasional hiccup or technical difficulty, a common trait among complex electronic devices. Experiencing iPhone problems can be frustrating, but usually no alarm is needed. In this comprehensive guide, we aim to demystify some of the most commonly encountered challenges associated with iPhone usage. Our step-by-step approach is designed to help you resolve these common issues, providing practical solutions and troubleshooting tips to get your equipment back in peak working order. Whether you're facing a glitch or a more complex problem, this article can help you resolve them effectively. General Troubleshooting Tips Before delving into specific troubleshooting steps, here are some helpful

The problem of generalization ability of machine learning models The problem of generalization ability of machine learning models Oct 08, 2023 am 10:46 AM

The generalization ability of machine learning models requires specific code examples. With the development and application of machine learning becoming more and more widespread, people are paying more and more attention to the generalization ability of machine learning models. Generalization ability refers to the prediction ability of a machine learning model on unlabeled data, and can also be understood as the adaptability of the model in the real world. A good machine learning model should have high generalization ability and be able to make accurate predictions on new data. However, in practical applications, we often encounter models that perform well on the training set, but fail on the test set or real

Label acquisition problem in weakly supervised learning Label acquisition problem in weakly supervised learning Oct 08, 2023 am 09:18 AM

The label acquisition problem in weakly supervised learning requires specific code examples. Introduction: Weakly supervised learning is a machine learning method that uses weak labels for training. Different from traditional supervised learning, weakly supervised learning only needs to use fewer labels to train the model, rather than each sample needs to have an accurate label. However, in weakly supervised learning, how to accurately obtain useful information from weak labels is a key issue. This article will introduce the label acquisition problem in weakly supervised learning and give specific code examples. Introduction to the label acquisition problem in weakly supervised learning:

Java documentation interpretation: Detailed explanation of the isAlphabetic() method of the Character class Java documentation interpretation: Detailed explanation of the isAlphabetic() method of the Character class Nov 04, 2023 am 10:05 AM

Interpretation of Java documentation: Detailed explanation of the isAlphabetic() method of the Character class 1. Overview In the Java Character class, the isAlphabetic() method is used to determine whether a given character is an alphabetic character. It returns a boolean value, true indicating that the given character is an alphabetic character, false indicating that the given character is not an alphabetic character. This article will provide a detailed analysis of the use and principle of this method, and provide code examples to help readers better understand

Reward design issues in reinforcement learning Reward design issues in reinforcement learning Oct 08, 2023 pm 01:09 PM

The problem of reward design in reinforcement learning requires specific code examples. Reinforcement learning is a machine learning method whose goal is to learn how to take actions that maximize cumulative rewards through interaction with the environment. In reinforcement learning, reward plays a crucial role. It is a signal in the learning process of the agent and is used to guide its behavior. However, reward design is a challenging problem, and reasonable reward design can greatly affect the performance of reinforcement learning algorithms. In reinforcement learning, rewards can be thought of as the agent versus the environment

See all articles