MySQL 8 - DROP or ALTER Causes ERROR 3664 (HY000): Failed to set SDI MySQL 8 - DROP or ALTER Causes ERROR 3664 (HY000): Failed to set SDI mysql mysql

MySQL 8 - DROP or ALTER Causes ERROR 3664 (HY000): Failed to set SDI


I and several of my students have been seeing this issue crop up more and more.

As a workaround I have found if you go in and do an analyze table on all the tables in the problem database it will fix this error until the next time you restart the server.


This is a related patch which is in mysql-8.0.11:

https://github.com/mysql/mysql-server/commit/261981bdf42c110f08f98ad2cf84ce6fdef1949e

sdi_debug.result seems to indicate that

SET GLOBAL DEBUG = '-d, sdi_delete_failure';

is needed to overcome the issue.


If you empty all of the tables, you can then drop the schema.

Interestingly, this statement works if using a PDO in PHP

$conn->exec("DROP DATABASE IF EXISTS $dbname");