InnoDB:Error:Table "MySQL". " Innodb_table_stats "not found.
Cause: seconds_behind_master:27360 mysql master-slave synchronization stop
Stop slave; Will always be stuck, service mysqld Restart, immediately again will stop syncing, the same problem occurs.
Preliminary judgment:
The master-Slave synchronization problem occurs because the Innodb_table_stats table is missing.
Workaround:
New Innodb_index_stats/innodb_tables_stats/slave_master_info/slave_relay_log_info/slave_worker_info Index Table
Innodb_index_stats
use mysqlcreate table ' Innodb_index_stats ' ( ' database_name ' varchar (64) 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;
Innodb_table_stats
Use mysqlcreate 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 (a) unsigned not null, ' sum_of_other_index_sizes ' B Igint (unsigned) not NULL, PRIMARY KEY (' database_name ', ' table_name ')) Engine=innodb DEFAULT Charset=utf8 Collate=utf8 _bin stats_persistent=0;
Slave_master_info
use mysqlcreate table ' Slave_master_info ' ( ' Number_of_lines ' int (10) unsigned NOT NULL COMMENT ' Number of lines in the file. ', ' Master_log_name ' text character set utf8 collate utf8_bin not NULL COMMENT ' the name of the master binary log currently being read from the master. ', ' Master_log_pos ' bigint ( ) unsigned not null comment ' the master log position of the Last read event. ', ' Host ' char (+) character set utf8 collate utf8_bin NOT NULL DEFAULT ' COMMENT ' the host name of the master. ', ' user_name ' text CHARACTER SET utf8 COLLATE utf8_bin comment ' The&nbsP;user name used to connect to the master. ', ' User_password ' text CHARACTER SET utf8 COLLATE utf8_bin COMMENT ' The password used to connect to the master. ', ' Port ' int (Ten) unsigned NOT NULL COMMENT ' the network port used to connect to The master. ', ' connect_retry ' int (Ten) unsigned NOT NULL COMMENT ' the period (in seconds) that the slave will wait before Trying to reconnect to the master. ', ' Enabled_ssl ' tinyint (1) not null comment ' indicates whether the server supports ssl Connections. ', ' Ssl_ca ' text character set utf8 collate utf8_bin COMMENT ' The file used for the Certificate Authority (CA) certificate. ', ' Ssl_ Capath ' text CHARACTER SET utf8 COLLATE utf8_bin COMMENT ' the path to the certificate authority (CA) certificates. ', ' Ssl_cert ' text CHARACTER SET utf8 COLLATE utf8_bin COMMENT ' the name Of the ssl certificate file. ', ' Ssl_cipher ' text character set utf8 COLLATE utf8_bin COMMENT ' The name of the cipher in use for the ssl connection. ', ' Ssl_key ' text character set utf8 COLLATE utf8_bin COMMENT ' The name of the ssl key file. ', ' Ssl_verify_server_cert ' tinyint (1) NOT NULL COMMENT ' Whether to verify the server certificate. ', ' Heartbeat ' float NOT NULL, ' Bind ' text character set utf8 collate utf8_bin comment ' Displays which Interface is employed when connecting to the mysql server ', ' Ignored_server_ids ' text character set utf8 collate utf8_bin comment ' the number of server ids to be ignored, followed by The actual server ids ', ' Uuid ' text CHARACTER SET utf8 collate utf8_bin comment ' The master server uuid. ', ' Retry_count ' bigint ( unsigned NOT NULL COMMENT ' number of reconnect Attempts, to the master, before giving up. ', ' Ssl_crl ' text character set utf8  collate utf8_bin comment ' the file used for the certificate revocation list (CRL) ', ' Ssl_crlpath ' text CHARACTER SET utf8 collate utf8_bin comment ' The path used for certificate revocation List (CRL) files ', ' enabled_auto_position ' tinyint (1) NOT NULL comment ' indicates whether gtids will be used to retrieve events from the master. ', primary key (' Host ', ' Port ') ENGINE=InnoDB Default charset=utf8 stats_persistent=0 comment= ' master information ';
Slave_relay_log_info
use mysqlcreate table ' Slave_relay_log_info ' ( ' Number_of_lines ' int (10) unsigned NOT NULL COMMENT ' Number of lines in the file or rows in the table. used to version table definitions. ', ' Relay_log_name ' text character set utf8 collate utf8_bin not NULL COMMENT ' The name of the current relay log file. ', ' Relay_log_pos ' bigint unsigned NOT NULL COMMENT ' The relay log position of the last executed event. ', ' Master_log_name ' text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT ' the name of the master binary log file from which the events in the relay log file were read. ', ' Master_log_pos ' bigint ( unsigned) NOT NULL COMMENT ' the master log position of the last Executed event. ', ' Sql_delay ' int (one) NOT NULL COMMENT ' the Number of seconds that the slave must lag behind the master. ' , ' Number_of_workers ' int (Ten) unsigned NOT NULL, ' Id ' int (10) unsigned NOT NULL COMMENT ' Internal id that uniquely identifies this record. ', primary key (' Id ')) ENGINE=InnoDB DEFAULT Charset=utf8 stats_persistent=0 comment= ' relay log information ';
Slave_worker_info
use mysqlcreate table ' Slave_worker_info ' ( ' Id ' int (Ten) unsigned NOT NULL, ' Relay_log_name ' text character set utf8 collate utf8_bin NOT NULL, ' Relay_log_pos ' bigint ( unsigned not null) , ' Master_log_name ' text character set utf8 collate utf8_bin not NULL, ' Master_log_pos ' bigint ( unsigned NOT NULL, ') Checkpoint_relay_log_name ' text character set utf8 collate utf8_bin not NULL, ' Checkpoint_relay_log_pos ' bigint ( unsigned NOT NULL, ) ' Checkpoint_master_log_name ' text character set utf8 collate utf8_bin NOT NULL, ' Checkpoint_master_log_pos ' bigint ( unsigned not null), ' checkpoint_seqno ' int (10) unsigned NOT NULL, ' checkpoint_group_size ' int (Ten) unsigned not NULL, ' Checkpoint_group_bitmap ' blob not null, primary key (' Id ')) engine=innodb default charset=utf8 stats_persistent=0 comment= ' Worker information ';
Or:
Re-import these 5 tables mysqldump in main MySQL.
Step : Goto a DB Server running MySQL 5.6, or install MySQL 5.6 on a test machine.
Step : mysqldump These 5 tables to a text file
Innodb_tables= "Innodb_index_stats" innodb_tables= "${innodb_tables} innodb_table_stats" INNODB_TABLES= "${INNODB_ TABLES} slave_master_info "innodb_tables=" ${innodb_tables} slave_relay_log_info "innodb_tables=" ${INNODB_TABLES} Slave_worker_info "Mysqldump-uroot MySQL ${innodb_tables} > Innodb_mysql_tables.sql
The prerequisite is to delete the 5 tables before creating or re-importing them.
drop table xx yy UU II;
Reference Documentation:
Http://dba.stackexchange.com/questions/54608/innodb-error-table-mysql-innodb-table-stats-not-found-after-upgrade-to-mys
InnoDB:Error:Table "MySQL". " Innodb_table_stats "Not found index table not found, master and slave stop