title: MySQL 8 - DROP or ALTER Causes ERROR 3664 (HY000): Failed to set SDI
body: <pre><code>ERROR 3664 (HY000): Failed to set SDI 'MyDatabase.MyTable' in tablespace 'mydatabase/mytable'.
  </code></pre>
  
  <p>I run into this error whenever trying to <code>DROP</code> a Database or <code>ALTER</code> a Table. I am unable to delete or alter any Table that I've created.</p>
  
  <p>Now, what's really interesting is that <strong>these errors only occur after restarting MySQL and a subsequent login (by root user) to MySQL</strong>. Here's the pattern:</p>
  
  <ol>
  <li>Login to MySQL as root user.</li>
  <li>Create a Database and create Tables.</li>
  <li><code>DROP</code> the Database or <code>ALTER</code> Tables with no issues <strong>:)</strong></li>
  <li>Exit MySQL</li>
  <li>Restart MySQL (stop then start)</li>
  <li>Login to MySQL as root user.</li>
  <li>Get ERROR 3664 when attempting to <code>DROP</code> the Database or <code>ALTER</code> Tables I previously created, hindering any <code>DROP</code> or <code>ALTER</code> <strong>:(</strong></li>
  </ol>
  
  <p>It seems that the restarting of MySQL allows it to recognize the new Database &amp; Table changes and update some kind of <a href="https://dev.mysql.com/doc/refman/8.0/en/serialized-dictionary-information.html" rel="noreferrer">SDI (Serialized Dictionary Information)</a> metadata associated with my <code>InnoDB</code> Database Tables and Tablespace I want to change. Somehow this recognition of SDI info is hindering my <code>ALTER</code> and <code>DROP</code> commands. <strong>Could this be a bug in MySQL? Or, could my root user not have permission to run commands that modify SDI data? (Although, the documentation says that SDI data is modified by an internal API.)</strong></p>
  
  <p>This happens to me EVERY TIME I create a Database and Tables. So, <strong>my very crippling workaround for this error</strong>:</p>
  
  <ol>
  <li>Manually delete the data files associated with the Database in the data directory.</li>
  <li>Call <code>DROP DATABASE IF EXISTS MyDatabase;</code> (may need to log out/in a couple times, or restart MySQL and try to access tables with <code>SELECT</code> statements for this to finally work)</li>
  <li>Recreate the Database and Tables needed.</li>
  </ol>
  
  <p>Any help would be greatly appreciated! Thank you!</p>
  
  <hr>
  
  <p>I'm running MySQL 8.0.11 Community Server on a Mac.</p>
  
  <p>The same issue with no solution: <a href="https://stackoverflow.com/questions/50061316/unable-to-drop-database-mysql-error-3664-hy000">Unable to drop database mysql: ERROR 3664 (HY000)</a></p>