3

I've got the same error, although I'm running galera cluster with 3 nodes. I tried following the instructions from InnoDB: Error: Table "mysql"."innodb_table_stats" not found after upgrade to mysql 5.6 but when I get to the step of running the create statements, I get the following error:

Error Code: 1813. Tablespace for table '`mysql`.`innodb_index_stats`' exists.
Please DISCARD the tablespace before IMPORT.

This made no sense to me, and when I tried to use

drop tablespace `innodb_index_stats`;

I got an SQL sysntax error.

RolandoMySQLDBA
185k34 gold badges327 silver badges541 bronze badges
asked Aug 19, 2015 at 21:44

1 Answer 1

10

The problem is actually very simple. Here is what happened

When you installed MySQL, the 5 InnoDB systems tables exist in two places

  • inside /var/lib/mysql/mysql as 5 .frm and 5 .ibd files
  • inside the data dictionary within ibdata1 (InnoDB System Tablespace)

At some point in your installation, you must have deleted ibdata1. This left the 10 InnoDB system table files inside /var/lib/mysql/mysql with no data dictionary entry.

SOLUTION

cd /var/lib/mysql/mysql
rm -f innodb_index_stats.frm
rm -f innodb_index_stats.ibd
rm -f innodb_table_stats.frm
rm -f innodb_table_stats.ibd
rm -f slave_master_info.frm
rm -f slave_master_info.ibd
rm -f slave_relay_log_info.frm
rm -f slave_relay_log_info.ibd
rm -f slave_worker_info.frm
rm -f slave_worker_info.ibd

Then, login to MySQL and run the steps from my post : InnoDB: Error: Table "mysql"."innodb_table_stats" not found after upgrade to mysql 5.6

GIVE IT A TRY !!!

answered Aug 19, 2015 at 22:11
1
  • Being that this was on a cluster, there was one small change to make in the procedure. I had to do the delete on all the servers first, then run the create statements from the provided link. Thank you for the help! Commented Aug 21, 2015 at 16:52

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.