I have a django app running on a staging server (windows server 2012) with a MariaDB database. I have a git hook running mysqldump locally when I push to the staging branch. On the server I have a batch script pulling from this branch, migrating django migrations, import the dump and finally restarting the site. Looks a bit like this:
@echo off D: cd <repo> cmd /k "git stuff && python manage.py migrate && mysql -uroot db < D:/repo/db.sql && stop/start site... && exit PAUSE
Sadly though when the script reaches the dump import it spits out an error saying it doesn't know the collation (
ERROR 1273 (HY000) at line 25: Unknown collation: 'utf8mb4_0900_ai_ci'
After some googling I found out I just have to open the sql in an editor and replace all 'utf8mb4_0900_ai_ci' with 'utf8mb4_general_ci'. Sure that works for this one time, that's not entirely useful for me as this dump is part of an automated process.
Does someone know a simple solution to automate the collation replacement?