Common user binary installation mariadb10.1.16 MySQL Library table corruption modification

Source: Internet
Author: User
Tags mysql delete

1) mariadb log:

10:36:48 140397816809216 [note] innodb: dumping buffer pool (s)  not yet  started2016-09-01 10:36:48 140510705071872 [warning] innodb: cannot open  table mysql/gtid_slave_pos from the internal data dictionary of  innodb though the .frm file for the table exists. see http:/ /dev.mysql.com/doc/refman/5.6/en/innodb-troubleshooting.html for how you can resolve  the problem.2016-09-01 10:36:48 140510705071872 [Warning] Failed to  load slave replication state from table mysql.gtid_slave_pos: 1932:  table  ' Mysql.gtid_slave_pos '  doesn ' t exist in engine2016-09-01 10:36:48  140510705289088 [note] server socket created on ip:  ' 0.0.0.0 '. 2016-09-01  10:36:48 140510704572160 [warning] innodb: cannot open table mysql/gtid_slave_pos from  the internal data dictionary of innodb though the .frm file  for the table exists. see http://dev.mysql.com/doc/refman/5.6/en/ Innodb-troubleshooting.html for how you can resolve the problem.2016-09-01  10:36:48 140510704572160 [warning] failed to load slave replication  state from table mysql.gtid_slave_pos: 1932: Table  ' Mysql.gtid_slave_pos '  DOESN ' T exist in engine


2) My machine mariadb damaged three sheets:

Innodb_table_statsinnodb_index_statsgtid_slave_pos

3) Online part of the method is as follows:

3.1 Find mariadb install directory share under Mysql_system_tables.sql This SQL into MySQL library execution source still problem

3.2 Open Mysql_system_tables.sql Find the Create these three table statements, manually executed, the problem still exists

4) My method:

4.1 Landing database----use MySQL;

drop table innodb_table_stats;  drop table innodb_index.stats; drop table Gtid_slave_pos;

\q Exit MARIADB

4.3 Enter the mariadb installation directory data MySQL delete three tables for IBD end table

Innodb_table_stats.ibdinnodb_index_stats.ibdgtid_slave_pos.ibd

4.4 Login mariadb Enter MySQL library to execute source

Source/home/innodb_table_stats.sqlsource/home/innodb_index_stats.sqlsource/home/gtid_slave_pos.sql

Restart MARIADB View Log no errors (note before operation if there is data to be backed up in advance, in case of an error to restore)

The three SQL table structures I've compiled from mysql_system_tables.sql. I've already packed and uploaded it.


Span style= "font-family: ' Song Body ', Simsun;font-size:20px;color:rgb (255,0,0);" > The first :

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; 



Second Photo: Innodb_index_stats

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; 


The third one: Gtid_slave_pos

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 ';


This article comes from "Recording now, remembering the future." "Blog, be sure to keep this provenance http://zhangchengjie.blog.51cto.com/1223266/1845222

Common user binary installation mariadb10.1.16 MySQL Library table corruption modification

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.