标签云
asm恢复 bbed bootstrap$ dul In Memory kcbzib_kcrsds_1 kccpb_sanity_check_2 MySQL恢复 ORA-00312 ORA-00607 ORA-00704 ORA-00742 ORA-01110 ORA-01555 ORA-01578 ORA-01595 ORA-08103 ORA-600 2131 ORA-600 2662 ORA-600 3020 ORA-600 4000 ORA-600 4137 ORA-600 4193 ORA-600 4194 ORA-600 16703 ORA-600 kcbzib_kcrsds_1 ORA-600 KCLCHKBLK_4 ORA-15042 ORA-15196 ORACLE 12C oracle dul ORACLE PATCH Oracle Recovery Tools oracle加密恢复 oracle勒索 oracle勒索恢复 oracle异常恢复 Oracle 恢复 ORACLE恢复 ORACLE数据库恢复 oracle 比特币 OSD-04016 YOUR FILES ARE ENCRYPTED 勒索恢复 比特币加密文章分类
- Others (2)
- 中间件 (2)
- WebLogic (2)
- 操作系统 (103)
- 数据库 (1,767)
- DB2 (22)
- MySQL (77)
- Oracle (1,608)
- Data Guard (52)
- EXADATA (8)
- GoldenGate (24)
- ORA-xxxxx (166)
- ORACLE 12C (72)
- ORACLE 18C (6)
- ORACLE 19C (15)
- ORACLE 21C (3)
- Oracle 23ai (8)
- Oracle ASM (69)
- Oracle Bug (8)
- Oracle RAC (54)
- Oracle 安全 (6)
- Oracle 开发 (28)
- Oracle 监听 (29)
- Oracle备份恢复 (590)
- Oracle安装升级 (97)
- Oracle性能优化 (62)
- 专题索引 (5)
- 勒索恢复 (86)
- PostgreSQL (30)
- pdu工具 (6)
- PostgreSQL恢复 (9)
- SQL Server (32)
- SQL Server恢复 (13)
- TimesTen (7)
- 达梦数据库 (3)
- 达梦恢复 (1)
- 生活娱乐 (2)
- 至理名言 (11)
- 虚拟化 (2)
- VMware (2)
- 软件开发 (39)
- Asp.Net (9)
- JavaScript (12)
- PHP (2)
- 小工具 (22)
-
最近发表
- ORA-00756 ORA-10567故障数据0丢失恢复
- 数据库文件变成32k故障恢复
- tcp连接过多导致监听TNS-12532 TNS-12560 TNS-00502错误
- 文件系统格式化MySQL数据库恢复
- .sstop勒索加密数据库恢复
- 解决一次硬件恢复之后数据文件0kb的故障恢复case
- Error in invoking target ‘libasmclntsh19.ohso libasmperl19.ohso client_sharedlib’问题处理
- ORA-01171: datafile N going offline due to error advancing checkpoint
- linux环境oracle数据库被文件系统勒索加密为.babyk扩展名溯源
- ORA-600 ksvworkmsgalloc: bad reaper
- ORA-600 krccfl_chunk故障处理
- Oracle Recovery Tools恢复案例总结—202505
- ORA-600 kddummy_blkchk 数据库循环重启
- 记录一次asm disk加入到vg通过恢复直接open库的案例
- CHECKDB 发现了 N 个分配错误和 M 个一致性错误
- 达梦数据库dm.ctl文件异常恢复
- Oracle Recovery Tools修复ORA-00742、ORA-600 ktbair2: illegal inheritance故障
- 可能是 tempdb 空间用尽或某个系统表不一致故障处理
- 11.2.0.4库中遇到ORA-600 kcratr_nab_less_than_odr报错
- [MY-013183] [InnoDB] Assertion failure故障处理
分类目录归档:MySQL
unknown variable ‘default-character-set=utf8′ 处理
分享一例由于mysql参数配置不当,当时mysql无法正常启动的case
[root@XIFENFEI ~]# service mysql start Redirecting to /bin/systemctl start mysql.service Job for mysqld.service failed because the control process exited with error code. See "systemctl status mysqld.service" and "journalctl -xe" for details. [root@XIFENFEI ~]# systemctl status mysqld.service mysqld.service - LSB: start and stop MySQL Loaded: loaded (/etc/rc.d/init.d/mysqld; bad; vendor preset: disabled) Active: failed (Result: exit-code) since Mon 2023-05-22 16:09:57 CST; 13s ago Docs: man:systemd-sysv-generator(8) Process: 101951 ExecStop=/etc/rc.d/init.d/mysqld stop (code=exited, status=0/SUCCESS) Process: 102545 ExecStart=/etc/rc.d/init.d/mysqld start (code=exited, status=1/FAILURE) May 22 16:09:53 RHAA08-0901 systemd[1]: Starting LSB: start and stop MySQL... May 22 16:09:57 RHAA08-0901 mysqld[102545]: Starting MySQL.... ERROR! The server quit without updating PID file (/www/se....pid). May 22 16:09:57 RHAA08-0901 systemd[1]: mysqld.service: control process exited, code=exited status=1 May 22 16:09:57 RHAA08-0901 systemd[1]: Failed to start LSB: start and stop MySQL. May 22 16:09:57 RHAA08-0901 systemd[1]: Unit mysqld.service entered failed state. May 22 16:09:57 RHAA08-0901 systemd[1]: mysqld.service failed. Hint: Some lines were ellipsized, use -l to show in full.
mysql日志
2023-05-22T06:59:57.646266Z 0 [Warning] option 'max_allowed_packet': unsigned value 107374182400 adjusted to 1073741824 2023-05-22T06:59:57.646480Z 0 [Note] --secure-file-priv is set to NULL. Operations related to importing and exporting data are disabled 2023-05-22T06:59:57.646548Z 0 [Note] /www/server/mysql/bin/mysqld (mysqld 5.7.41-log) starting as process 79451 ... 2023-05-22T06:59:57.726167Z 0 [Note] InnoDB: PUNCH HOLE support available 2023-05-22T06:59:57.726257Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins 2023-05-22T06:59:57.726269Z 0 [Note] InnoDB: Uses event mutexes 2023-05-22T06:59:57.726286Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier 2023-05-22T06:59:57.726296Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.12 2023-05-22T06:59:57.726306Z 0 [Note] InnoDB: Using Linux native AIO 2023-05-22T06:59:57.726975Z 0 [Note] InnoDB: Number of pools: 1 2023-05-22T06:59:57.727161Z 0 [Note] InnoDB: Using CPU crc32 instructions 2023-05-22T06:59:57.733999Z 0 [Note] InnoDB: Initializing buffer pool, total size = 4G, instances = 8, chunk size = 128M 2023-05-22T06:59:58.051369Z 0 [Note] InnoDB: Completed initialization of buffer pool 2023-05-22T06:59:58.087559Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority(). 2023-05-22T06:59:58.099727Z 0 [Note] InnoDB: Highest supported file format is Barracuda. 2023-05-22T06:59:58.202034Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables 2023-05-22T06:59:58.202150Z 0 [Note] InnoDB: Setting file '/www/server/data/ibtmp1' size to 12 MB. Physically writing the file full; Please wait ... 2023-05-22T06:59:58.242233Z 0 [Note] InnoDB: File '/www/server/data/ibtmp1' size is now 12 MB. 2023-05-22T06:59:58.244128Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active. 2023-05-22T06:59:58.244163Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active. 2023-05-22T06:59:58.244910Z 0 [Note] InnoDB: Waiting for purge to start 2023-05-22T06:59:58.295153Z 0 [Note] InnoDB: 5.7.41 started; log sequence number 1184000067 2023-05-22T06:59:58.295727Z 0 [Note] InnoDB: Loading buffer pool(s) from /www/server/data/ib_buffer_pool 2023-05-22T06:59:58.296135Z 0 [Note] Plugin 'FEDERATED' is disabled. 2023-05-22T06:59:58.296288Z 0 [Note] InnoDB: Buffer pool(s) load completed at 230522 14:59:58 2023-05-22T06:59:58.299095Z 0 [ERROR] unknown variable 'default-character-set=utf8' 2023-05-22T06:59:58.299131Z 0 [ERROR] Aborting 2023-05-22T06:59:58.299179Z 0 [Note] Binlog end 2023-05-22T06:59:58.299530Z 0 [Note] Shutting down plugin 'ngram' 2023-05-22T06:59:58.299560Z 0 [Note] Shutting down plugin 'partition' 2023-05-22T06:59:58.299572Z 0 [Note] Shutting down plugin 'BLACKHOLE' 2023-05-22T06:59:58.299588Z 0 [Note] Shutting down plugin 'ARCHIVE' 2023-05-22T06:59:58.299599Z 0 [Note] Shutting down plugin 'MyISAM' 2023-05-22T06:59:58.299626Z 0 [Note] Shutting down plugin 'MRG_MYISAM' 2023-05-22T06:59:58.299641Z 0 [Note] Shutting down plugin 'MEMORY' 2023-05-22T06:59:58.299657Z 0 [Note] Shutting down plugin 'PERFORMANCE_SCHEMA' 2023-05-22T06:59:58.299797Z 0 [Note] Shutting down plugin 'CSV' 2023-05-22T06:59:58.299811Z 0 [Note] Shutting down plugin 'INNODB_SYS_VIRTUAL' 2023-05-22T06:59:58.299822Z 0 [Note] Shutting down plugin 'INNODB_SYS_DATAFILES' 2023-05-22T06:59:58.299832Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESPACES' 2023-05-22T06:59:58.299843Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN_COLS' 2023-05-22T06:59:58.299853Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN' 2023-05-22T06:59:58.299863Z 0 [Note] Shutting down plugin 'INNODB_SYS_FIELDS' 2023-05-22T06:59:58.299873Z 0 [Note] Shutting down plugin 'INNODB_SYS_COLUMNS' 2023-05-22T06:59:58.299883Z 0 [Note] Shutting down plugin 'INNODB_SYS_INDEXES' 2023-05-22T06:59:58.299893Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESTATS' 2023-05-22T06:59:58.299904Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLES' 2023-05-22T06:59:58.299914Z 0 [Note] Shutting down plugin 'INNODB_FT_INDEX_TABLE' 2023-05-22T06:59:58.299924Z 0 [Note] Shutting down plugin 'INNODB_FT_INDEX_CACHE' 2023-05-22T06:59:58.299934Z 0 [Note] Shutting down plugin 'INNODB_FT_CONFIG' 2023-05-22T06:59:58.299944Z 0 [Note] Shutting down plugin 'INNODB_FT_BEING_DELETED' 2023-05-22T06:59:58.299954Z 0 [Note] Shutting down plugin 'INNODB_FT_DELETED' 2023-05-22T06:59:58.299964Z 0 [Note] Shutting down plugin 'INNODB_FT_DEFAULT_STOPWORD' 2023-05-22T06:59:58.299974Z 0 [Note] Shutting down plugin 'INNODB_METRICS' 2023-05-22T06:59:58.299984Z 0 [Note] Shutting down plugin 'INNODB_TEMP_TABLE_INFO' 2023-05-22T06:59:58.299995Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_POOL_STATS' 2023-05-22T06:59:58.300005Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE_LRU' 2023-05-22T06:59:58.300015Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE' 2023-05-22T06:59:58.300025Z 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX_RESET' 2023-05-22T06:59:58.300035Z 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX' 2023-05-22T06:59:58.300045Z 0 [Note] Shutting down plugin 'INNODB_CMPMEM_RESET' 2023-05-22T06:59:58.300055Z 0 [Note] Shutting down plugin 'INNODB_CMPMEM' 2023-05-22T06:59:58.300066Z 0 [Note] Shutting down plugin 'INNODB_CMP_RESET' 2023-05-22T06:59:58.300075Z 0 [Note] Shutting down plugin 'INNODB_CMP' 2023-05-22T06:59:58.300085Z 0 [Note] Shutting down plugin 'INNODB_LOCK_WAITS' 2023-05-22T06:59:58.300095Z 0 [Note] Shutting down plugin 'INNODB_LOCKS' 2023-05-22T06:59:58.300105Z 0 [Note] Shutting down plugin 'INNODB_TRX' 2023-05-22T06:59:58.300116Z 0 [Note] Shutting down plugin 'InnoDB' 2023-05-22T06:59:58.300271Z 0 [Note] InnoDB: FTS optimize thread exiting. 2023-05-22T06:59:58.300437Z 0 [Note] InnoDB: Starting shutdown... 2023-05-22T06:59:58.400764Z 0 [Note] InnoDB: Dumping buffer pool(s) to /www/server/data/ib_buffer_pool 2023-05-22T06:59:58.401153Z 0 [Note] InnoDB: Buffer pool(s) dump completed at 230522 14:59:58 2023-05-22T07:00:00.340582Z 0 [Note] InnoDB: Shutdown completed; log sequence number 1184000086 2023-05-22T07:00:00.343128Z 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1" 2023-05-22T07:00:00.343157Z 0 [Note] Shutting down plugin 'sha256_password' 2023-05-22T07:00:00.343165Z 0 [Note] Shutting down plugin 'mysql_native_password' 2023-05-22T07:00:00.343347Z 0 [Note] Shutting down plugin 'binlog' 2023-05-22T07:00:00.344547Z 0 [Note] /www/server/mysql/bin/mysqld: Shutdown complete
提示比较明显由于default-character-set=utf8参数设置不当当时,检查my.cnf配置,发现
在mysqld中配置了default-character-set=utf8,该参数正确配置为:character-set-server = utf8,设置正确参数值之后,mysql启动正常
[root@XIFENFEI data]# service mysql start Redirecting to /bin/systemctl start mysql.service [root@XIFENFEI data]# mysql -uroot -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 4 Server version: 5.7.41-log Source distribution Copyright (c) 2000, 2023, Oracle and/or its affiliates. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | 365xxxy | | xxxxhu | | xxxiuye | | mysql | | performance_schema | | xxxxchegn | | sxxxxp | | sys | | xxxxc | +--------------------+ 10 rows in set (0.00 sec)
发表在 MySQL
评论关闭
InnoDB: Database page corruption on disk or a failed file read of page恢复
MySQL 8.0版本ibd文件恢复
对于单个的ibd文件,大部分情况下可以通过DISCARD TABLESPACE和IMPORT TABLESPACE方式进行恢复
mysql> use test; Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Database changed mysql> CREATE TABLE `t1` ( -> `id` int DEFAULT NULL -> ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; Query OK, 0 rows affected (0.01 sec) mysql> insert into t1 values(1); Query OK, 1 row affected (0.02 sec) mysql> insert into t1 values(2); Query OK, 1 row affected (0.01 sec) mysql> insert into t1 values(3); Query OK, 1 row affected (0.00 sec)
关闭mysql服务,备份mysql中的t1.ibd文件
[root@xifenfei ~]# service mysql stop Shutting down MySQL..... SUCCESS! [root@xifenfei test]# cp t1.ibd t1_bak
启动mysql服务,并删除并创建新的t1表(表结构相同)
[root@xifenfei test]# service mysql start Starting MySQL..................... SUCCESS! [root@xifenfei test]# mysql -uroot -poracle test mysql: [Warning] Using a password on the command line interface can be insecure. Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 8 Server version: 8.0.31 MySQL Community Server - GPL Copyright (c) 2000, 2022, Oracle and/or its affiliates. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> drop table t1; Query OK, 0 rows affected (0.20 sec) mysql> mysql> CREATE TABLE `t1` ( -> `id` int DEFAULT NULL -> ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; Query OK, 0 rows affected (0.01 sec)
DISCARD TABLESPACE操作
mysql> ALTER TABLE t1 DISCARD TABLESPACE; Query OK, 0 rows affected (0.01 sec)
把备份的t1.ibd还原回去并修改权限
[root@xifenfei test]# mv t1_bak t1.ibd [root@xifenfei test]# ls -ltr total 112 -rw-r-----. 1 root root 114688 Dec 18 17:24 t1.ibd [root@xifenfei test]# chown mysql.mysql t1.ibd
IMPORT TABLESPACE并验证数据
mysql> ALTER TABLE t1 IMPORT TABLESPACE; Query OK, 0 rows affected, 1 warning (0.24 sec) mysql> select * from t1; +------+ | id | +------+ | 1 | | 2 | | 3 | +------+ 3 rows in set (0.00 sec)
在恢复途中如果遇到表定义不对,或者ibd文件损坏,或者版本不匹配等各种情况,可能在IMPORT TABLESPACE的时候可能出现类似ERROR 1808 (HY000): Schema mismatch (Clustered index validation failed. Because the .cfg file is missing, table definition of the IBD file could be different. Or the data file itself is already corrupted.)错误
mysql> alter table `t1` import tablespace; ERROR 1808 (HY000): Schema mismatch (Clustered index validation failed. Because the .cfg file is missing, table definition of the IBD file could be different. Or the data file itself is already corrupted.)
如果出现此类错误,无法直接通过该方法进行解决,参考frm和ibd文件数据库恢复,使用专业恢复工具进行处理