By thonhak23
Hi All,
I have tried to import a database from a shared hosting at Bluehost to a DB created in phpMyAdmin on Vesta CP on centos 7, but it generates this error:
ERROR 1273 (HY000) at line 183: Unknown collation: ‘utf8mb4_unicode_520_ci’
Can you please help guide how to fix this?
I very appreciate your support.
Regards
Thon
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
This error is caused when there is a difference in the MySQL server from which you have exported the database and the MySQL server to which you are importing.
To overcome this error, you will have to edit your SQL file and perform a search and replace, changing all instances of ‘utf8mb4_unicode_520_ci’ to ‘utf8mb4_unicode_ci’.
Utilising command line will be much easier here:
Save the SQL file in a directory. eg /root
Go to that directory using:
cd /root
sed -i ‘s/utf8mb4unicode520_ci/utf8mb4_unicode_ci/g’ database.sql
Replace the filename database.sql with the exact name.
Try importing this SQL file again.
Keep us posted if you need any further guidance on this and if there are additional questions or concerns please don’t hesitate to reply with them.
Regards, Prakash Jha Developer Support
Hi Prakash,
Thank you for your help.
I have tried two things:
The way you mentioned above by replacing that utf8mb4unicode520_ci with utf8mb4unicode which is available in phpMyAdmin. Importing DB from Bluehost to VPS server at Digital Ocean is successful without an error. However, it does not work as my website shows 500 ERRORs.
Upgrade MySQL v5.5 to MariaDB v10.3 using this guide:
https://www.mysterydata.com/update-upgrade-to-mariadb-10-3-on-vestacp-cwp-centos-7/
on CentOs 7. I can now create DB in phpMyAdmin on VestaCP and select utf8mb4unicode520_ci. Importing db from Bluehost without updating the string as in (1) is successful too. However, my website still shows 500 ERRORs.
Both the above debugings are not working for me.
Do you know what could cause that issue?
Cheers Thon
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.