国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 數據庫 > MySQL > 正文

MySQL異常恢復之無主鍵情況下innodb數據恢復的方法

2024-07-24 12:44:56
字體:
來源:轉載
供稿:網友

本文講述了MySQL異常恢復之無主鍵情況下innodb數據恢復的方法。,具體如下:

在mysql的innodb引擎的數據庫異常恢復中,一般都要求有主鍵或者唯一index,其實這個不是必須的,當沒有index信息之時,可以在整個表級別的index_id進行恢復

創建模擬表—無主鍵

mysql> CREATE TABLE `t1` ( -> `messageId` varchar(30) character set utf8 NOT NULL, -> `tokenId` varchar(20) character set utf8 NOT NULL, -> `mobile` varchar(14) character set utf8 default NULL, -> `msgFormat` int(1) NOT NULL, -> `msgContent` varchar(1000) character set utf8 default NULL, -> `scheduleDate` timestamp NOT NULL default '0000-00-00 00:00:00', -> `deliverState` int(1) default NULL, -> `deliverdTime` timestamp NOT NULL default '0000-00-00 00:00:00' -> ) ENGINE=INnodb DEFAULT CHARSET=utf8;Query OK, 0 rows affected (0.00 sec)mysql> insert into t1 select * from sms_service.sms_send_record;Query OK, 11 rows affected (0.00 sec)Records: 11 Duplicates: 0 Warnings: 0…………mysql> insert into t1 select * from t1;Query OK, 81664 rows affected (2.86 sec)Records: 81664 Duplicates: 0 Warnings: 0mysql> insert into t1 select * from t1;Query OK, 163328 rows affected (2.74 sec)Records: 163328 Duplicates: 0 Warnings: 0mysql> select count(*) from t1;+----------+| count(*) |+----------+| 326656 | +----------+1 row in set (0.15 sec)

解析innodb文件

[root@web103 mysql_recovery]# rm -rf pages-ibdata1/[root@web103 mysql_recovery]# ./stream_parser -f /var/lib/mysql/ibdata1 Opening file: /var/lib/mysql/ibdata1File information:ID of device containing file: 2049inode number: 1344553protection: 100660 (regular file)number of hard links: 1user ID of owner: 27group ID of owner: 27device ID (if special file): 0blocksize for filesystem I/O: 4096number of blocks allocated: 463312time of last access: 1440819443 Sat Aug 29 11:37:23 2015time of last modification: 1440819463 Sat Aug 29 11:37:43 2015time of last status change: 1440819463 Sat Aug 29 11:37:43 2015total size, in bytes: 236978176 (226.000 MiB)Size to process: 236978176 (226.000 MiB)Opening file: /var/lib/mysql/ibdata1File information:ID of device containing file: 2049inode number: 1344553protection: 100660 (regular file)number of hard links: 1user ID of owner: 27group ID of owner: 27device ID (if special file): 0blocksize for filesystem I/O: 4096number of blocks allocated: 463312Opening file: /var/lib/mysql/ibdata1File information:time of last access: 1440819443 Sat Aug 29 11:37:23 2015time of last modification: 1440819463 Sat Aug 29 11:37:43 2015ID of device containing file: 2049inode number: 1344553protection: 100660 time of last status change: 1440819463 Sat Aug 29 11:37:43 2015total size, in bytes: 236978176 (226.000 MiB)Size to process: 236978176 (226.000 MiB)Opening file: /var/lib/mysql/ibdata1File information:ID of device containing file: 2049inode number: 1344553protection: 100660 (regular file)number of hard links: 1user ID of owner: 27group ID of owner: 27device ID (if special file): 0blocksize for filesystem I/O: 4096number of blocks allocated: 463312time of last access: 1440819443 Sat Aug 29 11:37:23 2015time of last modification: 1440819463 Sat Aug 29 11:37:43 2015time of last status change: 1440819463 Sat Aug 29 11:37:43 2015total size, in bytes: 236978176 (226.000 MiB)Size to process: 236978176 (226.000 MiB)(regular file)number of hard links: 1user ID of owner: 27group ID of owner: 27device ID (if special file): 0blocksize for filesystem I/O: 4096number of blocks allocated: 463312time of last access: 1440819443 Sat Aug 29 11:37:23 2015time of last modification: 1440819463 Sat Aug 29 11:37:43 2015time of last status change: 1440819463 Sat Aug 29 11:37:43 2015total size, in bytes: 236978176 (226.000 MiB)Size to process: 236978176 (226.000 MiB)Opening file: /var/lib/mysql/ibdata1File information:ID of device containing file: 2049inode number: 1344553protection: 100660 (regular file)number of hard links: 1user ID of owner: 27group ID of owner: 27device ID (if special file): 0blocksize for filesystem I/O: 4096number of blocks allocated: 463312time of last access: 1440819443 Sat Aug 29 11:37:23 2015time of last modification: 1440819463 Sat Aug 29 11:37:43 2015time of last status change: 1440819463 Sat Aug 29 11:37:43 2015total size, in bytes: 236978176 (226.000 MiB)Size to process: 236978176 (226.000 MiB)Opening file: /var/lib/mysql/ibdata1File information:ID of device containing file: 2049inode number: 1344553protection: 100660 (regular file)number of hard links: 1user ID of owner: 27group ID of owner: 27device ID (if special file): 0blocksize for filesystem I/O: 4096number of blocks allocated: 463312time of last access: 1440819443 Sat Aug 29 11:37:23 2015time of last modification: 1440819463 Sat Aug 29 11:37:43 2015time of last status change: 1440819463 Sat Aug 29 11:37:43 2015Opening file: /var/lib/mysql/ibdata1File information:ID of device containing file: 2049inode number: 1344553protection: 100660 (regular file)number of hard links: 1user ID of owner: 27group ID of owner: 27device ID (if special file): 0blocksize for filesystem I/O: 4096number of blocks allocated: 463312total size, in bytes: 236978176 (226.000 MiB)Size to process: 236978176 (226.000 MiB)time of last access: 1440819443 Sat Aug 29 11:37:23 2015time of last modification: 1440819463 Sat Aug 29 11:37:43 2015time of last status change: 1440819463 Sat Aug 29 11:37:43 2015total size, in bytes: 236978176 (226.000 MiB)Size to process: 236978176 (226.000 MiB)Opening file: /var/lib/mysql/ibdata1File information:ID of device containing file: 2049inode number: 1344553protection: 100660 (regular file)number of hard links: 1user ID of owner: 27group ID of owner: 27device ID (if special file): 0blocksize for filesystem I/O: 4096number of blocks allocated: 463312time of last access: 1440819465 Sat Aug 29 11:37:45 2015time of last modification: 1440819463 Sat Aug 29 11:37:43 2015time of last status change: 1440819463 Sat Aug 29 11:37:43 2015total size, in bytes: 236978176 (226.000 MiB)Size to process: 236978176 (226.000 MiB)All workers finished in 0 sec
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 霞浦县| 县级市| 镇宁| 富宁县| 漠河县| 和顺县| 正蓝旗| 安达市| 巴东县| 宣城市| 武穴市| 彰化市| 温宿县| 广德县| 遵化市| 东莞市| 万载县| 雅江县| 株洲县| 阜宁县| 定结县| 泊头市| 老河口市| 南开区| 泗阳县| 罗源县| 通州市| 新乡市| 阳谷县| 定远县| 家居| 澄城县| 合水县| 聂拉木县| 绵阳市| 朝阳县| 叙永县| 雷州市| 甘谷县| 嘉义县| 加查县|