I have stack into this issue yesterday. Tried to import a db with mysql command line and i have seen the error message : ERROR 1273 (HY000) at line 33: Unknown collation: ‘utf8mb4_unicode_520_ci’
# mysql -uroot -p mydb < mydb1.sql # ERROR 1273 (HY000) at line 33: Unknown collation: 'utf8mb4_unicode_520_ci'
After i made a research found that the issue is with the database string format encoding. My database encoding is utf8 and the one i want to import is utf8mb4_unicode_520_ci.
So to fix this issue i need to edit the sql file that i have to import mydb1.sql. So i recommend anyone to use software like Sublime Text or some other light text editor to edit at least when you have big sql files.
Open editor click on Find > Replace and search for “utf8mb4” and replace with “utf8”. Click on Replace and save the file.
After that you have also to replace ‘unicode_520_ci’ with ‘general_ci’
Now you have to import the new saved sql file.
Hope this trick will help in similar case.
Check out also our other article about WordPress errors: How to fix parse error syntax error unexpected in WordPress