分享更有价值
被信任是一种快乐

MySQL磁盘空间满导致表空间相关数据文件损坏的处理方法

文章页正文上

这篇文章主要讲解了“MySQL磁盘空间满导致表空间相关数据文件损坏的处理方法”,文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习“MySQL磁盘空间满导致表空间相关数据文件损坏的处理方法”吧!近期,遇到一个mysql数据库因为磁盘空间满导致表空间相关数据文件损坏而无法启动,相关处理过程如下:1、mysql数据库磁盘空间满报错提示2019-09-30T01:25:10.326653+08:00 22822601 [Note] Aborted connection 22822601 to db: ‘unconnected’ user: ‘bpuser’ host: ‘localhost’ (Got an error reading communication packets)2019-09-30T01:25:12.893926+08:00 21573334 [ERROR] Disk is full writing ‘/data/mysql/mydata/blog/mysql-bin.002059′ (Errcode: 15425568 – No space left on device). Waiting for someone to free space…2019-09-30T01:25:12.893974+08:00 21573334 [ERROR] Retry in 60 secs. Message reprinted in 600 secs2019-09-30T01:25:27.822078+08:00 0 [ERROR] [FATAL] InnoDB: Native Linux AIO interface. io_submit() call failed when resubmitting a partial I/O request on the file ./mydata/history_uint2019-09-30T01:25:28.811224+08:00 0 [Note] –secure-file-priv is set to NULL. Operations related to importing and exporting data are disabled2、mysql重启失败报错提示2019-09-30T01:25:35.462390+08:00 0 [Note] InnoDB: Doing recovery: scanned up to log sequence number 19470290073602019-09-30T01:25:35.683704+08:00 0 [ERROR] InnoDB:
Space ID in fsp header is 4275156, but in the page header it is 164.2019-09-30T01:25:35.683774+08:00 0 [ERROR] InnoDB: Header page contains inconsistent data in datafile: ./mydata/history_uint#P#p201910130000.ibd, Space ID:18446744073709551615, Flags: 17039360. Please refer to http://dev.mysql.com/doc/refman/5.7/en/innodb-troubleshooting-datadict.html for how to resolve the issue.2019-09-30T01:25:35.683865+08:00 0 [Note] InnoDB: Page size:1024. Pages to analyze:64……2019-09-30T01:25:35.689292+08:00 0 [Note] InnoDB: Chosen space:1642019-09-30T01:25:35.689327+08:00 0 [ERROR] InnoDB: Corrupted page [page id: space=164, page number=0] of datafile ‘./mydata/his_uint#P#p201910130000.ibd’ could not be found in the doublewrite buffer…….2019-09-30T01:25:50.175443+08:00 0 [Note] InnoDB: Starting crash recovery.2019-09-30T01:25:50.462341+08:00 0 [ERROR] InnoDB: Tablespace 431 was not found at ./mydata/his_uint#P#p201910130000.ibd.2019-09-30T01:25:50.462391+08:00 0 [ERROR] InnoDB:
Set innodb_force_recovery=1 to ignore this and to permanently lose all changes to the tablespace.2019-09-30T01:25:50.481016+08:00 0 [ERROR] InnoDB: Cannot continue operation.2019-09-30T01:28:44.666477Z mysqld_safe Logging to ‘/data/mysql/mydata/errlog/mysql.err’.2019-09-30T01:28:44.736202Z mysqld_safe Starting mysqld daemon with databases from /data/mysql/mydata/data3、安装mysql报错日志提示在参数文件中加入:innodb_force_recovery=1 重新启动数据库,注意此参数是让数据库引擎忽略崩溃的事务或者数据块,会丢失数据。2019-09-30T14:59:29.161408+08:00 0 [Note] InnoDB: At LSN: 1947033396675: unable to open file ./mydata/history_uint#P#p201907310000.ibd for tablespace 3572019-09-30T14:59:29.173311+08:00 0 [Note] InnoDB: Doing recovery: scanned up to log sequence number 19470342502402019-09-30T14:59:29.391928+08:00 0 [Note] I免费主机域名nnoDB: Doing recovery: scanned up to log seq免费主机域名uence number 19470394931202019-09-30T14:59:29.619846+08:00 0 [Note] InnoDB: Doing recovery: scanned up to log sequence number 19470447360002019-09-30T14:59:29.883131+08:00 0 [Note] InnoDB: Doing recovery: scanned up to log sequence number 19470499788802019-09-30T14:59:30.150950+08:00 0 [Note] InnoDB: Doing recovery: scanned up to log sequence number 19470552217602019-09-30T14:59:30.412127+08:00 0 [Note] InnoDB: Doing recovery: scanned up to log sequence number 19470604646402019-09-30T14:59:30.682865+08:00 0 [Note] InnoDB: Doing recovery: scanned up to log sequence number 19470657075202019-09-30T14:59:30.946472+08:00 0 [Note] InnoDB: Doing recovery: scanned up to log sequence number 19470709504002019-09-30T14:59:31.208800+08:00 0 [Note] InnoDB: Doing recovery: scanned up to log sequence number 19470761932802019-09-30T14:59:31.488423+08:00 0 [Note] InnoDB: Doing recovery: scanned up to log sequence number 19470814361602019-09-30T14:59:31.769203+08:00 0 [Note] InnoDB: Doing recovery: scanned up to log sequence number 19470866790402019-09-30T14:59:32.046024+08:00 0 [Note] InnoDB: Doing recovery: scanned up to log sequence number 19470919219202019-09-30T14:59:32.323284+08:00 0 [Note] InnoDB: Doing recovery: scanned up to log sequence number 19470971648002019-09-30T14:59:32.602593+08:00 0 [Note] InnoDB: Doing recovery: scanned up to log sequence number 19471024076802019-09-30T14:59:32.879621+08:00 0 [Note] InnoDB: Doing recovery: scanned up to log sequence number 19471076505602019-09-30T14:59:33.162674+08:00 0 [Note] InnoDB: Doing recovery: scanned up to log sequence number 19471128934402019-09-30T14:59:33.443923+08:00 0 [Note] InnoDB: Doing recovery: scanned up to log sequence number 19471181363202019-09-30T14:59:33.722263+08:00 0 [Note] InnoDB: Doing recovery: scanned up to log sequence number 19471233792002019-09-30T14:59:34.005038+08:00 0 [Note] InnoDB: Doing recovery: scanned up to log sequence number 19471286220802019-09-30T14:59:34.277561+08:00 0 [Note] InnoDB: Doing recovery: scanned up to log sequence number 19471338649602019-09-30T14:59:34.553648+08:00 0 [Note] InnoDB: Doing recovery: scanned up to log sequence number 19471391078402019-09-30T14:59:34.837634+08:00 0 [Note] InnoDB: Doing recovery: scanned up to log sequence number 19471443507202019-09-30T14:59:35.126704+08:00 0 [Note] InnoDB: Doing recovery: scanned up to log sequence number 19471495936002019-09-30T14:59:35.405475+08:00 0 [Note] InnoDB: Doing recovery: scanned up to log sequence number 19471548364802019-09-30T14:59:35.677461+08:00 0 [Note] InnoDB: Doing recovery: scanned up to log sequence number 19471600793602019-09-30T14:59:35.955224+08:00 0 [Note] InnoDB: Doing recovery: scanned up to log sequence number 19471653222402019-09-30T14:59:36.234978+08:00 0 [Note] InnoDB: Doing recovery: scanned up to log sequence number 19471705651202019-09-30T14:59:36.507701+08:00 0 [Note] InnoDB: Doing recovery: scanned up to log sequence number 19471758080002019-09-30T14:59:36.787124+08:00 0 [Note] InnoDB: Doing recovery: scanned up to log sequence number 19471810508802019-09-30T14:59:37.072707+08:00 0 [Note] InnoDB: Doing recovery: scanned up to log sequence number 19471862937602019-09-30T14:59:37.352348+08:00 0 [Note] InnoDB: Doing recovery: scanned up to log sequence number 19471915366402019-09-30T14:59:37.553603+08:00 0 [Note] InnoDB: Doing recovery: scanned up to log sequence number 19471953794092019-09-30T14:59:37.554826+08:00 0 [Note] InnoDB: Database was not shutdown normally!2019-09-30T14:59:37.554862+08:00 0 [Note] InnoDB: Starting crash recovery.2019-09-30T14:59:37.639990+08:00 0 [Warning] InnoDB: Tablespace 431 was not found at ./mydata/his_uint#P#p201910130000.ibd, and innodb_force_recovery was set. All redo log for this tablespace will be ignored!2019-09-30T14:59:38.718448+08:00 0 [Note] InnoDB: Transaction 439021218 was in the XA prepared state.2019-09-30T14:59:38.718568+08:00 0 [Note] InnoDB: Since innodb_force_recovery > 0, we will force a rollback.2019-09-30T14:59:38.721677+08:00 0 [Note] InnoDB: Transaction 439021219 was in the XA prepared state.2019-09-30T14:59:38.721715+08:00 0 [Note] InnoDB: Since innodb_force_recovery > 0, we will force a rollback.2019-09-30T14:59:38.721742+08:00 0 [Note] InnoDB: Transaction 439021220 was in the XA prepared state.2019-09-30T14:59:38.721755+08:00 0 [Note] InnoDB: Since innodb_force_recovery > 0, we will force a rollback.2019-09-30T14:59:38.721785+08:00 0 [Note] InnoDB: Transaction 439021221 was in the XA prepared state.2019-09-30T14:59:38.721801+08:00 0 [Note] InnoDB: Since innodb_force_recovery > 0, we will force a rollback.2019-09-30T14:59:38.721932+08:00 0 [Note] InnoDB: Transaction 439021222 was in the XA prepared state.2019-09-30T14:59:38.721957+08:00 0 [Note] InnoDB: Since innodb_force_recovery > 0, we will force a rollback.2019-09-30T14:59:38.721976+08:00 0 [Note] InnoDB: Transaction 439021223 was in the XA prepared state.2019-09-30T14:59:38.721990+08:00 0 [Note] InnoDB: Since innodb_force_recovery > 0, we will force a rollback.2019-09-30T14:59:38.722051+08:00 0 [Note] InnoDB: Transaction 439021224 was in the XA prepared state.2019-09-30T14:59:38.722094+08:00 0 [Note] InnoDB: Since innodb_force_recovery > 0, we will force a rollback.2019-09-30T14:59:38.722122+08:00 0 [Note] InnoDB: Transaction 439021225 was in the XA prepared state.2019-09-30T14:59:38.722171+08:00 0 [Note] InnoDB: Since innodb_force_recovery > 0, we will rollback it anyway.2019-09-30T14:59:38.722285+08:00 0 [Note] InnoDB: Transaction 439021226 was in the XA prepared state.2019-09-30T14:59:38.722308+08:00 0 [Note] InnoDB: Since innodb_force_recovery > 0, we will force a rollback.2019-09-30T14:59:38.722337+08:00 0 [Note] InnoDB: Transaction 439021227 was in the XA prepared state.2019-09-30T14:59:38.722354+08:00 0 [Note] InnoDB: Since innodb_force_recovery > 0, we will force a rollback.2019-09-30T14:59:38.722374+08:00 0 [Note] InnoDB: Transaction 439021228 was in the XA prepared state.2019-09-30T14:59:38.722385+08:00 0 [Note] InnoDB: Since innodb_force_recovery > 0, we will force a rollback.2019-09-30T14:59:38.722416+08:00 0 [Note] InnoDB: Transaction 439021229 was in the XA prepared state.2019-09-30T14:59:38.722429+08:00 0 [Note] InnoDB: Since innodb_force_recovery > 0, we will rollback it anyway.2019-09-30T14:59:38.891187+08:00 0 [Note] InnoDB: Transaction 439021230 was in the XA prepared state.2019-09-30T14:59:38.891241+08:00 0 [Note] InnoDB: Since innodb_force_recovery > 0, we will rollback it anyway.2019-09-30T14:59:38.891272+08:00 0 [Note] InnoDB: Transaction 439021231 was in the XA prepared state.2019-09-30T14:59:38.891294+08:00 0 [Note] InnoDB: Since innodb_force_recovery > 0, we will rollback it anyway.2019-09-30T14:59:38.891349+08:00 0 [Note] InnoDB: Transaction 439021232 was in the XA prepared state.2019-09-30T14:59:38.891372+08:00 0 [Note] InnoDB: Since innodb_force_recovery > 0, we will rollback it anyway.2019-09-30T14:59:38.951935+08:00 0 [Note] InnoDB: Transaction 439021233 was in the XA prepared state.2019-09-30T14:59:38.951987+08:00 0 [Note] InnoDB: Since innodb_force_recovery > 0, we will rollback it anyway.2019-09-30T14:59:38.952095+08:00 0 [Note] InnoDB: Transaction 439021234 was in the XA prepared state.2019-09-30T14:59:38.952118+08:00 0 [Note] InnoDB: Since innodb_force_recovery > 0, we will rollback it anyway.2019-09-30T14:59:38.952211+08:00 0 [Note] InnoDB: Transaction 439021235 was in the XA prepared state.2019-09-30T14:59:38.952231+08:00 0 [Note] InnoDB: Since innodb_force_recovery > 0, we will rollback it anyway.2019-09-30T14:59:38.952274+08:00 0 [Note] InnoDB: 18 transaction(s) which must be rolled back or cleaned up in total 1320 row operations to undo2019-09-30T14:59:38.952292+08:00 0 [Note] InnoDB: Trx id counter is 4390215682019-09-30T14:59:38.952422+08:00 0 [Note] InnoDB: Starting an apply batch of log records to the database…InnoDB: Progress in percent: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 992019-09-30T14:59:55.205973+08:00 0 [Note] InnoDB: Apply batch completed2019-09-30T14:59:55.206099+08:00 0 [Note] InnoDB: Last MySQL binlog file position 0 220761212, file name mysql-bin.0020592019-09-30T14:59:55.353727+08:00 0 [Note] InnoDB: Starting in background the rollback of uncommitted transactions2019-09-30T14:59:55.353918+08:00 0 [Note] InnoDB: Rolling back trx with id 439021235, 1 rows to undo2019-09-30T14:59:55.355905+08:00 0 [Note] InnoDB: Removed temporary tablespace data file: “ibtmp1″2019-09-30T14:59:55.355970+08:00 0 [Note] InnoDB: Creating shared tablespace for temporary tables2019-09-30T14:59:55.356072+08:00 0 [Note] InnoDB: Setting file ‘/data/mysql/mydata/data/ibtmp1’ size to 12 MB. Physically writing the file full; Please wait …2019-09-30T14:59:55.360842+08:00 0 [Note] InnoDB: File ‘/data/mysql/mydata/data/ibtmp1’ size is now 12 MB.2019-09-30T14:59:55.362952+08:00 0 [Note] InnoDB: Rollback of trx with id 439021235 completed2019-09-30T14:59:55.363004+08:00 0 [Note] InnoDB: Rolling back trx with id 439021234, 1 rows to undo2019-09-30T14:59:55.364047+08:00 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.2019-09-30T14:59:55.364097+08:00 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.2019-09-30T14:59:55.364756+08:00 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 28917ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)2019-09-30T14:59:55.364864+08:00 0 [Note] InnoDB: 5.7.21 started; log sequence number 19471953794092019-09-30T14:59:55.364942+08:00 0 [Note] InnoDB: !!! innodb_force_recovery is set to 2 !!!2019-09-30T14:59:55.365252+08:00 0 [Note] InnoDB: Loading buffer pool(s) from /data/mysql/mydata/data/ib_buffer_pool2019-09-30T14:59:55.365982+08:00 0 [Note] Plugin ‘FEDERATED’ is disabled.2019-09-30T14:59:55.374150+08:00 0 [Note] InnoDB: Rollback of trx with id 439021234 completed2019-09-30T14:59:55.374211+08:00 0 [Note] InnoDB: Rolling back trx with id 439021233, 1 rows to undo2019-09-30T14:59:55.374303+08:00 0 [Note] InnoDB: Rollback of trx with id 439021233 completed2019-09-30T14:59:55.374353+08:00 0 [Note] InnoDB: Rolling back trx with id 439021232, 2 rows to undo2019-09-30T14:59:55.385121+08:00 0 [Note] InnoDB: Rollback of trx with id 439021232 completed2019-09-30T14:59:55.385173+08:00 0 [Note] InnoDB: Rolling back trx with id 439021231, 4 rows to undo2019-09-30T14:59:55.385291+08:00 0 [Note] InnoDB: Rollback of trx with id 439021231 completed2019-09-30T14:59:55.385329+08:00 0 [Note] InnoDB: Rolling back trx with id 439021230, 1 rows to undo2019-09-30T14:59:55.385430+08:00 0 [Note] InnoDB: Rollback of trx with id 439021230 completed2019-09-30T14:59:55.385465+08:00 0 [Note] InnoDB: Rolling back trx with id 439021229, 1 rows to undo2019-09-30T14:59:55.385596+08:00 0 [Note] InnoDB: Rollback of trx with id 439021229 completed2019-09-30T14:59:55.385634+08:00 0 [Note] InnoDB: Rolling back trx with id 439021228, 288 rows to undo2019-09-30T14:59:55.419044+08:00 0 [Note] Semi-sync replication initialized for transactions.2019-09-30T14:59:55.419087+08:00 0 [Note] Semi-sync replication enabled on the master.2019-09-30T14:59:55.420374+08:00 0 [Note] Starting ack receiver thread2019-09-30T14:59:55.443313+08:00 0 [Note] Recovering after a crash using /data/mysql/mydata/blog/mysql-bin2019-09-30T14:59:55.989634+08:00 0 [Note] InnoDB: Rollback of trx with id 439021228 completed2019-09-30T14:59:55.989688+08:00 0 [Note] InnoDB: Rolling back trx with id 439021227, 33 rows to undo2019-09-30T14:59:56.031958+08:00 0 [Note] InnoDB: Rollback of trx with id 439021227 completed2019-09-30T14:59:56.032008+08:00 0 [Note] InnoDB: Rolling back trx with id 439021226, 122 rows to undo2019-09-30T14:59:56.206430+08:00 0 [Note] InnoDB: Rollback of trx with id 439021226 completed2019-09-30T14:59:56.206608+08:00 0 [Note] InnoDB: Rolling back trx with id 439021225, 6 rows to undo2019-09-30T14:59:56.206979+08:00 0 [Note] InnoDB: Rollback of trx with id 439021225 completed2019-09-30T14:59:56.207023+08:00 0 [Note] InnoDB: Rolling back trx with id 439021224, 3 rows to undo2019-09-30T14:59:56.207246+08:00 0 [Note] InnoDB: Rollback of trx with id 439021224 completed2019-09-30T14:59:56.207275+08:00 0 [Note] InnoDB: Rolling back trx with id 439021223, 31 rows to undo2019-09-30T14:59:56.253734+08:00 0 [Note] InnoDB: Rollback of trx with id 439021223 completed2019-09-30T14:59:56.253781+08:00 0 [Note] InnoDB: Rolling back trx with id 439021222, 1 rows to undo2019-09-30T14:59:56.253885+08:00 0 [Note] InnoDB: Rollback of trx with id 439021222 completed2019-09-30T14:59:56.253940+08:00 0 [Note] InnoDB: Rolling back trx with id 439021221, 340 rows to undo2019-09-30T14:59:56.261028+08:00 0 [ERROR] Error in Log_event::read_log_event(): ‘read error’, data_len: 1103, event_type: 292019-09-30T14:59:56.261118+08:00 0 [Note] Starting crash recovery…2019-09-30T14:59:56.261182+08:00 0 [Note] Crash recovery finished.2019-09-30T14:59:56.261336+08:00 0 [Note] Crashed binlog file /data/mysql/mydata/blog/mysql-bin.002059 size is 220762112, but recovered up to 220761212. Binlog trimmed to 220761212 bytes.2019-09-30T14:59:56.747437+08:00 0 [Note] InnoDB: Rollback of trx with id 439021221 completed2019-09-30T14:59:56.747493+08:00 0 [Note] InnoDB: Rolling back trx with id 439021220, 169 rows to undo2019-09-30T14:59:57.105815+08:00 0 [Note] InnoDB: Rollback of trx with id 439021220 completed2019-09-30T14:59:57.105928+08:00 0 [Note] InnoDB: Rolling back trx with id 439021219, 35 rows to undo2019-09-30T14:59:57.156088+08:00 0 [Note] InnoDB: Rollback of trx with id 439021219 completed2019-09-30T14:59:57.156133+08:00 0 [Note] InnoDB: Rolling back trx with id 439021218, 281 rows to undo2019-09-30T14:59:57.345363+08:00 0 [Note] InnoDB: Rollback of trx with id 439021218 completed2019-09-30T14:59:57.345408+08:00 0 [Note] InnoDB: Rollback of non-prepared transactions completed2019-09-30T14:59:57.790483+08:00 0 [ERROR] InnoDB: innodb_force_recovery is on. We do not allow database modifications by the user. Shut down mysqld and edit my.cnf to
set innodb_force_recovery=0mysqld: Operation not allowed when innodb_forced_recovery > 0.2019-09-30T14:59:57.790649+08:00 0 [ERROR] Aborting4、根据提示将innodb_forced_recovery设置为0,重新启动数据库成功2019-09-30T15:20:29.097172+08:00 0 [Note] Semi-sync replication enabled on the master.2019-09-30T15:20:29.097330+08:00 0 [Note] Starting ack receiver thread2019-09-30T15:20:29.126933+08:00 0 [Warning] Failed to set up SSL because of the following SSL library error: SSL context is not usable without certificate and private key2019-09-30T15:20:29.126992+08:00 0 [Note] Server hostname (bind-address): ‘*’; port: 33062019-09-30T15:20:29.127081+08:00 0 [Note] IPv6 is available.2019-09-30T15:20:29.127120+08:00 0 [Note] – ‘::’ resolves to ‘::’;2019-09-30T15:20:29.127160+08:00 0 [Note] Server socket created on IP: ‘::’.5、关于innodb_forced_recovery扩展innodb_force_recovery可以设置为1-6,大的数字包含前面所有数字的影响。当设置参数值大于0后,可以对表进行select,create,drop操作,但insert,update或者delete这类操作是不允许的。1(SRV_FORCE_IGNORE_CORRUPT):忽略检查到的corrupt页。2(SRV_FORCE_NO_BACKGROUND):阻止主线程的运行,如主线程需要执行full purge操作,会导致crash。3(SRV_FORCE_NO_TRX_UNDO):不执行事务回滚操作。4(SRV_FORCE_NO_IBUF_MERGE):不执行插入缓冲的合并操作。5(SRV_FORCE_NO_UNDO_LOG_SCAN):不查看重做日志,InnoDB存储引擎会将未提交的事务视为已提交。6(SRV_FORCE_NO_LOG_REDO):不执行前滚的操作。感谢各位的阅读,以上就是“MySQL磁盘空间满导致表空间相关数据文件损坏的处理方法”的内容了,经过本文的学习后,相信大家对MySQL磁盘空间满导致表空间相关数据文件损坏的处理方法这一问题有了更深刻的体会,具体使用情况还需要大家实践验证。这里是云技术,小编将为大家推送更多相关知识点的文章,欢迎关注!

相关推荐: mysql中pt-osc工具怎么用

这篇文章将为大家详细讲解有关mysql中pt-osc工具怎么用,小编觉得挺实用的,因此分享给大家做个参考,希望大家阅读完这篇文章后可以有所收获。 使用方法:pt-online-schema-change h=*,u=* p=**,P=* ,D=enk,t=my…

文章页内容下
赞(0) 打赏
版权声明:本站采用知识共享、学习交流,不允许用于商业用途;文章由发布者自行承担一切责任,与本站无关。
文章页正文下
文章页评论上

云服务器、web空间可免费试用

宝塔面板主机、支持php,mysql等,SSL部署;安全高速企业专供99.999%稳定,另有高防主机、不限制内容等类型,具体可咨询QQ:360163164,Tel同微信:18905205712

主机选购导航云服务器试用

登录

找回密码

注册