1. Roll back and reinstall mysql
In order to avoid the trouble of importing this data from other places, first reinstall the current database Make a backup of the database file (/var/lib/mysql/location). Next, I uninstalled the Percona server 5.7 package, reinstalled the original 5.1.71 package, and started the mysql service. It prompted Unknown/unsupported table type: innodb and could not start normally.
110509 12:04:27 InnoDB: Initializing buffer pool, size = 384.0M 110509 12:04:27 InnoDB: Completed initialization of buffer pool InnoDB: Error: log file ./ib_logfile0 is of different size 0 5242880 bytes InnoDB: than specified in the .cnf file 0 157286400 bytes! 110509 12:04:27 [ERROR] Plugin 'InnoDB' init function returned error. 110509 12:04:27 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed. 110509 12:04:27 [ERROR] Unknown/unsupported table type: innodb 110509 12:04:27 [ERROR] Aborting 110509 12:04:27 [Note] /usr/sbin/mysqld: Shutdown complete
Delete the /var/lib/mysql/ directory, restart the database service, and initialize it. It is found to be normal. Show engines can find the innodb engine. Then stop the database, overwrite the contents of the previously backed up /var/lib/mysql/ directory with the contents of the current location, and restart. I also found that it could not be started, and the error content was the same as before.
The structure of the contents of the /var/lib/mysql directory is as follows:
-rw-rw---- 1 mysql mysql 10485760 2月 26 18:10 ibdata1 -rw-rw---- 1 mysql mysql 5242880 2月 26 18:10 ib_logfile0 -rw-rw---- 1 mysql mysql 5242880 2月 26 17:20 ib_logfile1 drwx------ 2 mysql mysql 4096 2月 26 17:20 mysql drwx------ 2 mysql mysql 4096 2月 26 17:24 wiki
The wiki directory is the library for test data, the ibdata1 file is the data file, the two files starting with ib are log files, mysql The directory contains system library-related things. Use the initialized data again, and overwrite the wiki directory and ibdata1 file to the /var/lib/mysql directory. You can start normally and log in normally.
2. Reinstall the innodb module
However, when backing up through mysqldump, it prompts unknown table engine "Innodb". After logging in, check all the current engine types and find that the innodb type does not exist among them:

Use the alter command to modify the type of one of the tables to MyISAM. , and found that an error was still reported.

Through find, it is found that there is a ha_innodb_plugin.so file in the /usr/lib64/mysql/plugin/ directory. I have the impression that later versions of mysql5 support online plug-in installation. Check the following to confirm that it is indeed supported:

install plugin innodb soname 'ha_innodb.so';3. BackupIn Add the following configuration to /etc/my.cnf:
plugin-load=innodb=ha_innodb_plugin.so plugin_dir=/usr/lib64/mysql/plugin/ default-storage-engine=InnoDBFound that the startup still failed. Check mysql-error.log and find the following content:
InnoDB: Database page corruption on disk or a failed InnoDB: file read of page 7. InnoDB: You may have to recover from a backup. InnoDB: It is also possible that your operating InnoDB: system has corrupted its own file cache InnoDB: and rebooting your computer removes the InnoDB: error. InnoDB: If the corrupt page is an index page InnoDB: you can also try to fix the corruption InnoDB: by dumping, dropping, and reimporting InnoDB: the corrupt table. You can use CHECK InnoDB: TABLE to scan your table for corruption. InnoDB: See also http://dev.mysql.com/doc/refman/5.1/en/forcing-innodb-recovery.htmlOpen the official forcing-innodb-recovery page and find that you can force startup and recovery by specifying the innodb_force_recovery parameter. Add the following content to /etc/my.cnf:
innodb_force_recovery=6Restart successful. There is no problem with backing up through mysqldump. Importing the backup data to other hosts can also be found to be normal and can be tested. Now it’s easy. Delete mysql completely and reinstall Percona server 5.7. After installation, build the database, restore the data, reconnect the program, and everything is OK.
The above is the detailed content of How to handle mysql innodb exception. For more information, please follow other related articles on the PHP Chinese website!

本篇文章给大家带来了关于mysql的相关知识,其中主要介绍了关于架构原理的相关内容,MySQL Server架构自顶向下大致可以分网络连接层、服务层、存储引擎层和系统文件层,下面一起来看一下,希望对大家有帮助。

mysql的msi与zip版本的区别:1、zip包含的安装程序是一种主动安装,而msi包含的是被installer所用的安装文件以提交请求的方式安装;2、zip是一种数据压缩和文档存储的文件格式,msi是微软格式的安装包。

方法:1、利用right函数,语法为“update 表名 set 指定字段 = right(指定字段, length(指定字段)-1)...”;2、利用substring函数,语法为“select substring(指定字段,2)..”。

在mysql中,可以利用char()和REPLACE()函数来替换换行符;REPLACE()函数可以用新字符串替换列中的换行符,而换行符可使用“char(13)”来表示,语法为“replace(字段名,char(13),'新字符串') ”。

转换方法:1、利用cast函数,语法“select * from 表名 order by cast(字段名 as SIGNED)”;2、利用“select * from 表名 order by CONVERT(字段名,SIGNED)”语句。

本篇文章给大家带来了关于mysql的相关知识,其中主要介绍了关于MySQL复制技术的相关问题,包括了异步复制、半同步复制等等内容,下面一起来看一下,希望对大家有帮助。

在mysql中,可以利用REGEXP运算符判断数据是否是数字类型,语法为“String REGEXP '[^0-9.]'”;该运算符是正则表达式的缩写,若数据字符中含有数字时,返回的结果是true,反之返回的结果是false。

本篇文章给大家带来了关于mysql的相关知识,其中主要介绍了mysql高级篇的一些问题,包括了索引是什么、索引底层实现等等问题,下面一起来看一下,希望对大家有帮助。


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

SublimeText3 Chinese version
Chinese version, very easy to use

WebStorm Mac version
Useful JavaScript development tools

Zend Studio 13.0.1
Powerful PHP integrated development environment

SublimeText3 Linux new version
SublimeText3 Linux latest version

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.
