Skip to content

Instantly share code, notes, and snippets.

@0xMatt
Forked from amurrell/sed-collation-issue-fixes
Created March 30, 2022 20:57
Show Gist options
  • Save 0xMatt/86800120133a540be8167c3a812d5ed6 to your computer and use it in GitHub Desktop.
Save 0xMatt/86800120133a540be8167c3a812d5ed6 to your computer and use it in GitHub Desktop.
Fix collation and character set error from old mysql
# Unknown collation: 'utf8mb4_unicode_520_ci'
sed -i'.bak' "s/utf8mb4_unicode_520_ci/utf8mb4_unicode_ci/g;" file.sql
# COLLATION 'utf8_general_ci' is not valid for CHARACTER SET 'utf8mb4'
sed -i'.bak' "s/utf8_general_ci/utf8mb4_unicode_ci/g;" file.sql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment