Unable to upgrade Ghost from v4.2.0 to v4.3.0 (CASCADE - UNKNOWN_CODE_PLEASE_REPORT)

Works for me as well. Thank you @jebarjonet

Hi, now I am getting the following error:

Ghost container:
ERROR SELECT 1+1 as RESULT; - ER_NEW_ABORTING_CONNECTION: Aborted connection 3 to db: 'ghost' user: 'ghost' host: 'ghost.522.ghost.522' (init_connect command failed)

Mysql container:

ghost.522.mariadb | 2021-05-08 23:27:32 3 [Warning] Aborted connection 3 to db: 'ghost' user: 'ghost' host: 'ghost.522.ghost.522' (init_connect command failed)
ghost.522.mariadb | 2021-05-08 23:27:32 3 [Warning] Unknown system variable 'default_collation_for_utf8mb4'
ghost.522.mariadb | 2021-05-08 23:27:34 4 [Warning] Aborted connection 4 to db: 'ghost' user: 'ghost' host: 'ghost.522.ghost.522' (init_connect command failed)
ghost.522.mariadb | 2021-05-08 23:27:34 4 [Warning] Unknown system variable 'default_collation_for_utf8mb4'
ghost.522.mariadb | 2021-05-08 23:27:36 5 [Warning] Aborted connection 5 to db: 'ghost' user: 'ghost' host: 'ghost.522.ghost.522' (init_connect command failed)
ghost.522.mariadb | 2021-05-08 23:27:36 5 [Warning] Unknown system variable 'default_collation_for_utf8mb4'

Anybody? Thanks

Thanks a lot @jebarjonet !

Shouldn’t ghost be made compatible with the new MySQL 8.0 default collation utf8mb4_0900_ai_ci ?

It is compatible with utf8mb4_0900_ai_ci. This issue is a database administration issue, Ghost is not involved. Incompatibility comes from newly created tables (from Ghost or not) with Ubuntu 20, with the previous ones before the DO update, with Ubuntu 18. If you create a new droplet, update it immediately then run Ghost for the first time, everything will be utf8mb4_0900_ai_ci and run smoothly

Cool

Thank you!! This was exactly the tip that I needed! I was nearing reinstall territory and this saved me the trouble. Funny how simple it turned out to be in the end. Kudos @jebarjonet!!!

I have the same issue upgrading from 4.12.1 to 4.16.0.
I Use cloud server from Hetzner.de

Message: Ghost was able to start, but errored during boot with: alter table members_product_events add constraint members_product_events_member_id_foreign foreign key (member_id) references members (id) on delete CASCADE - UNKNOWN_CODE_PLEASE_REPORT: Referencing column ‘member_id’ and referenced column ‘id’ in foreign key constraint ‘members_product_events_member_id_foreign’ are incompatible.
Help: Error occurred while executing the following migration: 02-add-members-products-events-table.js

Debug Information:
OS: Ubuntu, v20.04.3 LTS
Node Version: v14.17.6
Ghost Version: 4.16.0
Ghost-CLI Version: 1.17.3
Environment: production
Command: ‘ghost start’

I am really frustrated because I haven’t done any backup and my website hasn’t been working for several days already.

Any help is appreciated.

Thank you.

Incredible work. Thanks!

You saved my day. Thanks.