mariadb10.x installation mode is Yum, when you enable Gtid replication, you are prompted to Mysql.gtid_slave_pos solutions that are not found
The cause is unknown
Solution:/usr/share/mysql/mysql_system_tables.sql is a script that creates system tables
Find how the Innodb_table_stats,innodb_index_stats,gtid_slave_pos table was created
Create statement for Innodb_table_stats table:
set foreign_key_checks=0;drop table if exists ' Innodb_table_stats '; create table ' Innodb_table_stats ' ( ' database_name ' varchar (+) collate utf8_bin NOT NULL, ' table_name ' varchar (+) COLLATE utf8_bin not null, ' Last_update ' timestamp not null default current_timestamp ON UPDATE CURRENT_TIMESTAMP, ' N_rows ' bigint ( unsigned NOT ) null, ' Clustered_index_size ' bigint ( unsigned NOT NULL, ' sum_of_ Other_index_sizes ' bigint unsigned NOT NULL, PRIMARY KEY (' database_name ', ' table_name ')) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin stats_persistent=0;
innodb_index_stats table creation statement:
set foreign_key_checks=0;drop table if exists ' Innodb_index_stats '; create table ' Innodb_index_stats ' ( ' database_name ' varchar (+) collate utf8_bin NOT NULL, ' table_name ' varchar (+) COLLATE utf8_bin not null, ' index_name ' varchar ( COLLATE utf8_bin NOT NULL, ) ' Last_update ' timestamp not null default current_timestamp on update CURRENT_TIMESTAMP, ' Stat_name ' varchar ( collate utf8_bin not null) , ' Stat_value ' bigint ( unsigned NOT NULL, ' sample_size ' bigint unsigned DEFAULT NULL, ' stat_description ' varchar (1024x768) collate utf8_bin NOT NULL, PRIMARY KEY (' database_name ', ' table_name ', ' index_name ' , ' Stat_name ')) engine=innodb default charset=utf8 collate=utf8_bin stats_persistent=0;
Create statement for Gtid_slave_pos table:
SET foreign_key_checks=0;drop TABLE IF EXISTS ' Gtid_slave_pos '; CREATE TABLE ' Gtid_slave_pos ' (' domain_id ' int () unsigned not null, ' sub_id ' bigint (a) unsigned not null, ' Server_i d ' Int (ten) unsigned NOT NULL, ' Seq_no ' bigint (a) unsigned not NULL, PRIMARY KEY (' domain_id ', ' sub_id ')) Engine=innodb D Efault charset=latin1 comment= ' Replication slave GTID position ';
You can resolve a problem that the table cannot find by executing the following command:
Mysql-uroot-p123456-e "Drop mysql.table innodb_table_stats;" Mysql-uroot-p123456-e "Drop mysql.table innodb_index_stats;" Mysql-uroot-p123456-e "Drop mysql.table gtid_slave_pos;" mv/data/mysql/mysql/innodb_index_stats.ibd/tmpmv/data/mysql/mysql/innodb_table_stats.ibd/tmpmv/data/mysql/ Mysql/gtid_slave_pos.ibd/tmpmysql-uroot-p123456-e "Use Mysql;source/root/innodb_index_stats.sql;" Mysql-uroot-p123456-e "Use Mysql;source/root/innodb_table_stats.sql;" Mysql-uroot-p123456-e "Use Mysql;source/root/gtid_slave_pos.sql;" /etc/init.d/mysql restart
This article is from the "burning Years of Passion" blog, please be sure to keep this source http://liuzhengwei521.blog.51cto.com/4855442/1930338
Mariadb10.x a solution that Mysql.gtid_slave_pos not found when Gtid replication is enabled