Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to solve the problem that Mysql database prompts that innodb table does not exist

2025-04-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

The main content of this article is to explain "how to solve the problem that Mysql database prompts innodb table does not exist", interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Next let the editor to take you to learn "how to solve the problem that Mysql database prompts innodb table does not exist"!

It was found that there was an error in mysql's error.log:

InnoDB: Error: Table "mysql". "innodb_table_stats" not found.

InnoDB: Error: Fetch of persistent statistics requested for table "hj_web". "wechat_res" but the required system tables mysql.innodb_table_stats and mysql.innodb_index_stats are not present or have unexpected structure. Using transient stats instead.

Then you need to rebuild the five tables of mysql, the databases:

Steps:

1. Log in to the database, enter the mysql library, and delete 5 tables by executing the following SQL

Remember, it has to be drop table if exists.

Mysql > use mysql;mysql > drop table if exists innodb_index_stats; mysql > drop table if exists innodb_table_stats; mysql > drop table if exists slave_master_info; mysql > drop table if exists slave_relay_log_info; mysql > drop table if exists slave_worker_info

After execution, you can check with show tables to see if the data in the table has been reduced compared with that before deletion. If so, you have succeeded!

2. After the previous step is completed, stop the database, go to the directory where the database data file is located, and delete the idb file corresponding to the above five tables, as shown below:

# / etc/init.d/mysqld stop# cd / data/mysql/data/mysql/# ls-l * .ibd-rw-rw---- 1 mysql mysql 98304 May 27 14:17 innodb_index_stats.ibd-rw-rw---- 1 mysql mysql 98304 May 27 14:17 innodb_table_stats.ibd-rw-rw---- 1 mysql mysql 98304 May 27 14:14 slave_master_info.ibd-rw-rw---- 1 mysql mysql 98304 May 27 14:14 slave_ Relay_log_info.ibd-rw-rw---- 1 mysql mysql 98304 May 27 14:14 slave_worker_info.ibd

# / bin/rm-rf * .ibd

3. Restart the database, go to the mysql library, and rebuild the deleted table structure above:

The table creation script for the database can be found in the share directory of the installation directory of the mysql software or the script directory of the installation package of mysql. Here we can find:

# find /-name mysql_system_tables.sql/usr/local/mysql-5.6.29/scripts/mysql_system_tables.sql# / etc/init.d/mysqld startmysql > use mysql;mysql > source / usr/local/mysql-5.6.29/scripts/mysql_system_tables.sqlmysql > show tables;28 rows in set (0.00 sec)

Then take a look at one or two of the five tables under desc:

Mysql > desc innodb_table_stats;mysql > desc slave_master_info

Finally, check mysql's error.log log.

After confirming that there are no new errors, it indicates success.

At this point, I believe you have a deeper understanding of "how to solve the problem that Mysql database prompts innodb table does not exist". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 297

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report