(Resolved) Unknown collation: ‘utf8mb4_0900_ai_ci’

My old MySQL server using DigitalOcean one-click installer was

mysql Ver 8.0.19 for Linux on x86_64 (MySQL Community Server - GPL)

At new Linode server, I was using MariaDB

mysql Ver 15.1 Distrib 10.3.22-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2

While migrating database db.sql file, I got an error message saying Unknown collation: ‘utf8mb4_0900_ai_ci’

root@localhost:/var/www/html# mysql -u gulshan -p gulshan < db.sql Enter password: ERROR 1273 (HY000) at line 145: Unknown collation: 'utf8mb4_0900_ai_ci'

I found this solution worked for me.

sed -i db.sql -e 's/utf8mb4_0900_ai_ci/utf8mb4_unicode_ci/g'