MySQL 8.0 initialization

  Database, Documentation, MySQL
Tags: , , ,

MySQL 8.x not only requires that the datadir be empty when initializing, but also the directory designated as the temp directory.  If the temp directory is not empty, the –initialize flag will not throw an error as it does if the datadir isn’t clean; rather, it will cause a “Data Dictionary initialization failed” message on startup, post-initialization. This is because the initialization routine creates temporary tablespace and a temporary data dictionary in the temp directory, but doesn’t clean up after itself.

As long as you rm -rf * everything in *both* directories first, everything works fine.