Updating Ghost from MySql 5 to 8
Isaac Lewis,I recently updated my Ghost blogging software, and ran into some trouble regarding the MySql update. I think this was because I was updating Ghost, MySql, and Ubuntu all at the same time. Here's what fixed it for me.
First off, the big thing to learn is that MySql 8 changes the default collation of UTF8 β this caused some issues with upgrading, and downgrading the collation default seemed to fix it. It was kind of fiddly, but here's how I did it:
- Upgrade to MySql 8
I did this by upgrading Ubuntu to a new LTS version. - Reset the default collation
I did this in the MySql conf file,/etc/mysql/my.cnf
file:
[mysqld]
init_connect='SET default_collation_for_utf8mb4=utf8mb4_general_ci'
- Verify the collation setting
$ mysql -u root -p -e 'use mysql; SELECT @@default_collation_for_utf8mb4'
This should returnutf8mb4_general_ci
- Install Ghost
After this collation setting was reverted to the old version, Ghost installed properly.