標籤:mysql failed 二進位 使用者
1)mariadb日誌:
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)我本機mariadb損壞了三張表 :
innodb_table_statsinnodb_index_statsgtid_slave_pos
3)網上部分方法如下:
3.1找到mariadb安裝目錄share下mysql_system_tables.sql這調sql進入mysql庫下執行source 依然問題有問題
3.2 開啟mysql_system_tables.sql找到create 這三張表語句,手動執行,問題還是存在
4)我的方法:
4.1登陸資料庫----use mysql;
drop table innodb_table_stats; drop table innodb_index.stats; drop table gtid_slave_pos;
\q 退出mariadb
4.3進入mariadb安裝目錄data下mysql刪除 三張表以為ibd結尾的表
innodb_table_stats.ibdinnodb_index_stats.ibdgtid_slave_pos.ibd
4.4在次登陸mariadb進入mysql庫執行source
source /home/innodb_table_stats.sqlsource /home/innodb_index_stats.sqlsource /home/gtid_slave_pos.sql
重新啟動mariadb查看日誌沒有錯誤了(注意在操作前如果有資料要提前備份,為了以防出錯還原)
這三個sql表結構是我從mysql_system_tables.sql整理出來的。我已經打包上傳了。
第一張:innodb_table_stats
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;
第二張:innodb_index_stats
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_description` 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;
第三張:gtid_slave_pos
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‘;
本文出自 “記錄現在,回憶未來。” 部落格,請務必保留此出處http://zhangchengjie.blog.51cto.com/1223266/1845222
普通使用者二進位安裝mariadb10.1.16 mysql庫表損壞修改