MySQL 8 is the only supported database in production.
ghost ls
to locate your install and navigate to its location.
ghost config database.client
this should output sqlite3
or mysql
.
mysql --version
to find the details of your mysql install.
utf8mb4_0900_ai_ci
.
Running the following command will generate a set of ALTER TABLE
commands needed to correct your database:
mysql <database> -u <username> -p -B --disable-column-names -h localhost -e 'SELECT CONCAT("ALTER TABLE ",TABLE_SCHEMA,".",TABLE_NAME," CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci; ", "ALTER TABLE ",TABLE_SCHEMA,".",TABLE_NAME," CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci;") AS alter_sql FROM information_schema.TABLES WHERE TABLE_SCHEMA = database();'
Once you have the alter table commands, run:
mysql <database> -u <username> -p 'set foreign_key_checks=0; <ALTER TABLE COMMANDS> set foreign_key_checks=1;'