1. 程式人生 > >MySQL主從報錯解決:Table ‘mysql.gtid_slave_pos’ doesn’t exist

MySQL主從報錯解決:Table ‘mysql.gtid_slave_pos’ doesn’t exist

給內部一個數據庫做異地熱備,熱備部分採用了 MariaDB 的 galera 叢集模式。然後挑選其中一臺作為 Slave 和深圳主叢集做主從同步。

主叢集是老環境,用的版本還是是 MySQL 5.5.13。用常規辦法建立主從同步

12 MariaDB[(none)]>change master tomaster_host='192.168.1.100',master_user='rpl',master_password='[email protected]',master_log_file='mysql-bin.001091',MASTER_LOG_POS=137962110,master_connect_retry=30;MariaDB[(none)]>start slave;

結果有如下報錯:

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 MariaDB[(none)]>show slave status\G***************************1.row ***************************Slave_IO_State:Waiting formaster tosend eventMaster_Host:192.168.1.100Master_User:rplMaster_Port:3306Connect_Retry:30Master_Log_File:mysql-bin.001093Read_Master_Log_Pos:77139171Relay_Log_File:udb158-relay-bin.000002Relay_Log_Pos:237764027Relay_Master_Log_File:mysql-bin.001091Slave_IO_Running:YesSlave_SQL_Running:YesReplicate_Do_DB:Replicate_Ignore_DB:Replicate_Do_Table:Replicate_Ignore_Table:Replicate_Wild_Do_Table:Replicate_Wild_Ignore_Table:Last_Errno:1146Last_Error:Unable toload replication GTID slave state from mysql.gtid_slave_pos:Table'mysql.gtid_slave_pos'doesn't exist                 Skip_Counter: 0          Exec_Master_Log_Pos: 375725743              Relay_Log_Space: 2086663884              Until_Condition: None               Until_Log_File:                 Until_Log_Pos: 0           Master_SSL_Allowed: No           Master_SSL_CA_File:            Master_SSL_CA_Path:               Master_SSL_Cert:             Master_SSL_Cipher:                Master_SSL_Key:         Seconds_Behind_Master: 105914Master_SSL_Verify_Server_Cert: No                Last_IO_Errno: 0                Last_IO_Error:                Last_SQL_Errno: 1146               Last_SQL_Error: Unable to load replication GTID slave state from mysql.gtid_slave_pos: Table 'mysql.gtid_slave_pos' doesn'texistReplicate_Ignore_Server_Ids:Master_Server_Id:15410Master_SSL_Crl:Master_SSL_Crlpath:Using_Gtid:NoGtid_IO_Pos:1row inset(0.00sec)

錯誤資訊為:Last_SQL_Error: Unable to load replication GTID slave state from mysql.gtid_slave_pos: Table 'mysql.gtid_slave_pos' doesn't exist

搜了下資料,大部分說是沒有執行 mysql_upgrade 導致的,不過我們這邊的 MariaDB 是 Docker 跑的,而且用了很長時間了,理論上應該是沒問題的才對。

既然提示沒有這個表:Table 'mysql.gtid_slave_pos' doesn't exist,那我就建立一個吧!

從網上找到這個建表語句:

1234567 CREATE TABLE`gtid_slave_pos`(`domain_id`int(10)unsignedNOTNULL,`sub_id`bigint(20)unsignedNOTNULL,`server_id`int(10)unsignedNOTNULL,`seq_no`bigint(20)unsignedNOTNULL,PRIMARY KEY(`domain_id`,`sub_id`))ENGINE=MyISAM DEFAULTCHARSET=utf8 COMMENT='Replication slave GTID state';

在作為 Slave 的 MariaDB 上執行,然後重啟 slave 後問題解決,過程如下:

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117 MariaDB[(none)]>show slave status\G***************************1.row ***************************Slave_IO_State:Waiting formaster tosend eventMaster_Host:192.168.1.100Master_User:rplMaster_Port:3306Connect_Retry:30Master_Log_File:mysql-bin.001093Read_Master_Log_Pos:77139171Relay_Log_File:udb158-relay-bin.000002Relay_Log_Pos:237764027Relay_Master_Log_File:mysql-bin.001091Slave_IO_Running:YesSlave_SQL_Running:YesReplicate_Do_DB:Replicate_Ignore_DB:Replicate_Do_Table:Replicate_Ignore_Table:Replicate_Wild_Do_Table:Replicate_Wild_Ignore_Table:Last_Errno:1146Last_Error:Unable toload replication GTID slave state from mysql.gtid_slave_pos:Table'mysql.gtid_slave_pos'doesn't exist                 Skip_Counter: 0          Exec_Master_Log_Pos: 375725743              Relay_Log_Space: 2086663884              Until_Condition: None               Until_Log_File:                 Until_Log_Pos: 0           Master_SSL_Allowed: No           Master_SSL_CA_File:            Master_SSL_CA_Path:               Master_SSL_Cert:             Master_SSL_Cipher:                Master_SSL_Key:         Seconds_Behind_Master: 105914Master_SSL_Verify_Server_Cert: No                Last_IO_Errno: 0                Last_IO_Error:                Last_SQL_Errno: 1146               Last_SQL_Error: Unable to load replication GTID slave state from mysql.gtid_slave_pos: Table 'mysql.gtid_slave_pos' doesn'texistReplicate_Ignore_Server_Ids:Master_Server_Id:15410Master_SSL_Crl:Master_SSL_Crlpath:Using_Gtid:NoGtid_IO_Pos:1row inset(0.00sec)MariaDB[(none)]>usemysql;Reading table information forcompletion of table andcolumn namesYou can turn off thisfeature togetaquicker startup with-ADatabase changedMariaDB[mysql]>CREATE TABLE`gtid_slave_pos`(->`domain_id`int(10)unsignedNOTNULL,->`sub_id`bigint(20)unsignedNOTNULL,->`server_id`int(10)unsignedNOTNULL,->`seq_no`bigint(20)unsignedNOTNULL,->PRIMARY KEY(`domain_id`,`sub_id`)->)ENGINE=MyISAM DEFAULTCHARSET=utf8 COMMENT='Replication slave GTID state';Query OK,0rows affected(0.01sec)MariaDB[mysql]>stop slave;Query OK,0rows affected(0.04sec)MariaDB[mysql]>start slave;Query OK,0rows affected(0.00sec)MariaDB[mysql]>show slave status\G***************************1.row ***************************Slave_IO_State:Queueing master event tothe relay logMaster_Host:192.168.1.100Master_User:rplMaster_Port:3306

相關推薦

MySQL主從解決Tablemysql.gtid_slave_posdoesnt exist

給內部一個數據庫做異地熱備,熱備部分採用了 MariaDB 的 galera 叢集模式。然後挑選其中一臺作為 Slave 和深圳主叢集做主從同步。 主叢集是老環境,用的版本還是是 MySQL 5.5.13。用常規辦法建立主從同步 MariaDB [(none)]

】BatchUpdateException: Table 'right_test_db.user' doesn't exist

log4j:WARN Please initialize the log4j system properly. log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info. Tue Jun 28 14:2

解決方法Table 'performance_schema.session_variables' doesn't exist

Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. T

SQLyog 2058 連線 mysql 8.0.11 解決方法

今天閒來無事,下載新版的 mysql 8.0.11 安裝。為了方便安裝檢視,我下載了sqlyog 工具 連線 mysql配置新連線報錯:錯誤號碼 2058,分析是 mysql 密碼加密方法變了。解決方法:windows 下cmd 登入 mysql -u root -p 登入你

Mysql安裝解決辦法

base edi 註意 eve program 搜索 重新啟動 5.1 edit .msi版MySQL安裝包在安裝最後執行的時候到第三部或者第四部死掉 主要是因為之前安裝的版本沒有卸載幹凈,要卸載幹凈MySQ安裝包有一些幾個步驟: 1.通過卸載程序MySQL的相關組件 2。

mysql socket解決方法

mysql socket報錯解決方法[root@cml python]# python test.py slave_statusTraceback (most recent call last): File "test.py", line 14, in <module>

python2.x下pip install mysql-python解決辦法

分享圖片 alt info pan www. 下載 ima sql pytho 在https://www.lfd.uci.edu/~gohlke/pythonlibs/#mysql-python 下載該驅動網盤鏈接:https://pan.baidu.com/s/1r0

linux上 mysql主從處理常見方式

1:mysql從庫上,重置slave,重新指定master資訊    RESET SLAVE;    change master to master_host='主庫ip',master_user='zzh',master_password='Zzh91121

VMware+CentOS7配置mysql主從

錯誤資訊: Fatal error: The slave I/O thread stops because master and slave have equal MySQL server UUIDs; these UUIDs must be different for replicatio

騰訊雲CentOS7安裝mysql各種解決辦法!!以及Navicat連線(服務啟動不了解決辦法)

先釋放一下!氣死我了!! 背景: 在雲主機上安裝mysql來來回回重灌了十幾遍,氣得我昨晚還把雲主機的系統重灌了一遍!!!但是並沒有解決根本問題。最終還是今天上午解決了! 我安裝的mysql是5.6 首先說一下我的錯誤步驟!記住一下是錯誤步驟!

mysql主從

mysql> show slave status\G *************************** 1. row ***************************                Sl

Centos 6.6 Mysql 安裝解決

[[email protected] /]# rpm -ivh mysql-community-server-5.7.11-1.el6.x86_64.rpmwarning: mysql-community-server-5.7.11-1.el6.x86_64.rpm

Mysql 主從

1、在從庫上面show slave status\G;出現下列情況,   Slave_IO_Running: Yes   Slave_SQL_Running: No   Seconds_Behind_Master: NULL 原因:程式可能在 slave 上進行來寫操作;

zabbix服務器環境--安裝過程中的解決【Error: Package】

解決 could gen 分析 finish cli agent base 通過 # 錯誤提示: --> Finished Dependency Resolution Error: Package: php-ldap-5.4.16-42.el7.x86_64 (bas

java呼叫郵箱解決Client was not authenticated to send anonymous mail during MAIL FROM

郵件傳送報錯資訊 com.sun.mail.smtp.SMTPSendFailedException: 530 5.7.57 SMTP; Client was not authenticated to send anonymous mail during MAIL FROM 錯誤資訊:

hibernate解決Unable to instantiate default tuplizer

java 專案啟動報錯 Caused by: org.hibernate.HibernateException: Unable to instantiate default tuplizer [org.hibernate.tuple.entity.PojoEntityTuplizer]

Pycharm解決error:please select a valid Python interpreter

問題描述: 之前PC上安裝的是Python2,後來工作需要轉成Python3了。然後在用pycharm執行Python2的程式時發現源程式執行報錯(出去語法錯誤) error:please select a valid Python interpreter 問題原因: 在pycharm匯入源專案的

svn解決Previous operation has not finished; run 'cleanup' if it was interrupted

背景,在更新專案的時候,更新一半突然出現了error,隨後重新更新,結果出現了下面的錯誤 專案上的svn圖示也不見了。 試了刪專案也沒用,在任何一級目錄操作均報此問題; 上網查瞭解決辦法,挺複雜,確沒效果,比如在專案.svn目錄下各種操作,都沒起作用,結果,專案上點

YUM解決rpmdb open failed

repo onf main failed emp The ultra edi ril yum安裝某個軟件的時候,出現報錯 [root@aws ~]# yum install -y zabbix-agent rpmdb: unable to join the environm

升級jdk8後系統解決java.lang.RuntimeException: java.io.IOException: invalid constant type: 18

今天專案從jdk7升級到jdk8,Tomcat啟動竟然報出這個執行時錯誤。 錯誤資訊:java.io.IOException: invalid constant type: 18 2015-09-17 09:06:16:ERROR localhost-startStop-1 org.s