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
  • 185,223
  • 33
  • 326
  • 536
Aaron
  • 151
  • 1
  • 3
  • 7

1 Answers1

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 !!!

RolandoMySQLDBA
  • 185,223
  • 33
  • 326
  • 536