Expected to open 2 undo tablespaces but was able to find only 0 undo tablespaces.
We recently tried setting innodb_undo_tablespaces=2 for our mysql 5.7 server. But during the restart the server returned with:
[ERROR] InnoDB: Expected to open 2 undo tablespaces but was able to find only 0 undo tablespaces. Set the innodb_undo_tablespaces parameter to the correct value and retry. Suggested value is 0
It turns out this is already documented : "The number of innodb_undo_tablespaces must be set prior to initializing InnoDB. Attempting to restart InnoDB with a greater number of undo tablespaces than you specified when you first created the database will result in a failed start and an error stating that InnoDB did not find the expected number of undo tablespaces."
What does "first created the database" mean? Does the documentation mean a fresh installation of mysql where there are no databases within the server? Is there a way to bypass this requirement?
Answers:
Probably refers to "fresh installation".
The workaround is painful...
- Dump all the data.
- Stop mysqld.
- Blow away ibdata1 and iblogs.
- Change the setting in my.cnf.
- Restart. (This should feel like a 'fresh' install.)
- Reload the data.
Do you have some indication that changing that setting will help you significantly? If so, please explain. It is a very new feature, and is there for a reason, but not many users need it.
解决方法:删掉ibdata1再重启
浙公网安备 33010602011771号