Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Prompt what to do if mysql.gtid_slave_pos cannot be found when mariadb10.x enables gtid replication

2025-04-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Let's learn what to do when mariadb10.x enables gtid replication when it is prompted not to find mysql.gtid_slave_pos. I believe you will benefit a lot after reading it. The text is not in the essence. I hope that when mariadb10.x enables gtid replication, you will be prompted how to find mysql.gtid_slave_pos. This short article is what you want.

Solution: / usr/share/mysql/mysql_system_tables.sql is a script that creates system tables

Find out how to create the innodb_table_stats,innodb_index_stats,gtid_slave_pos table

The creation statement of the innodb_table_stats table:

SET FOREIGN_KEY_CHECKS=0;DROP TABLE IF EXISTS `innodb_table_ stats` CREATE TABLE `innodb_table_ stats` (`database_ name` varchar (64) COLLATE utf8_bin NOT NULL, `table_ name` varchar (64) COLLATE utf8_bin NOT NULL, `last_ update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `n_ rows` bigint (20) unsigned NOT NULL, `clustered_index_ size` bigint (20) unsigned NOT NULL, `sum_of_other_index_ sizes` bigint (20) unsigned NOT NULL, PRIMARY KEY (`database_ name`, `table_ name`) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin STATS_PERSISTENT=0

The creation statement of the innodb_index_stats table:

SET FOREIGN_KEY_CHECKS=0;DROP TABLE IF EXISTS `innodb_index_ stats` CREATE TABLE `innodb_index_ stats` (`database_ name` varchar (64) COLLATE utf8_bin NOT NULL, `table_ name` varchar (64) COLLATE utf8_bin NOT NULL, `index_ name` varchar (64) COLLATE utf8_bin NOT NULL, `last_ update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `stat_ name` varchar (64) COLLATE utf8_bin NOT NULL, `stat_ value` bigint (20) unsigned NOT NULL, `sample_ size` bigint (20) unsigned DEFAULT NULL, `stat_ substitution`varchar (1024) 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

The creation statement of the gtid_slave_pos table:

SET FOREIGN_KEY_CHECKS=0;DROP TABLE IF EXISTS `gtid_slave_ Pos`; CREATE TABLE `gtid_slave_ Pos` (`domain_ id` int (10) unsigned NOT NULL, `sub_ id` bigint (20) unsigned NOT NULL, `server_ id` int (10) unsigned NOT NULL, `seq_ no` bigint (20) unsigned NOT NULL, PRIMARY KEY (`domain_ id`, `sub_ id`) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='Replication slave GTID position'

Execute the following command to resolve the problem that the table cannot be found:

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

After reading this article that tells you what to do when mariadb10.x enables gtid replication, many readers will want to know more about it. If you need more industry information, you can follow our industry information section.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report