{"id":2132,"date":"2017-09-29T16:42:53","date_gmt":"2017-09-29T11:12:53","guid":{"rendered":"https:\/\/pheonixsolutions.com\/blog\/?p=2132"},"modified":"2026-09-12T11:52:35","modified_gmt":"2026-09-12T06:22:35","slug":"unknown-collation-utf8mb4-unicode-520-ci","status":"publish","type":"post","link":"https:\/\/pheonixsolutions.com\/blog\/unknown-collation-utf8mb4-unicode-520-ci\/","title":{"rendered":"How to Fix MySQL Error 1273: Unknown Collation &#8216;utf8mb4_unicode_520_ci&#8217;"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">Introduction<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Database migrations are a routine task for developers, system administrators, and website owners. However, moving a MySQL database between servers can sometimes lead to compatibility issues, especially when the source and destination servers are running different MySQL versions. One such common problem is <strong>ERROR 1273 (HY000): Unknown collation &#8216;utf8mb4_unicode_520_ci&#8217;<\/strong>, which prevents a database dump from being imported successfully.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This error occurs because the target MySQL server does not recognize the collation used in the backup file. In this guide, we&#8217;ll explain why this issue occurs, how to fix it quickly, and the best practices to prevent collation-related problems during future database migrations.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Error Message<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Recently, while restoring a MySQL database dump from one server to another, the import process failed with the following error:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2017\/09\/ChatGPT-Image-Sep-12-2026-11_47_40-AM.png\"><img fetchpriority=\"high\" decoding=\"async\" width=\"1024\" height=\"342\" src=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2017\/09\/ChatGPT-Image-Sep-12-2026-11_47_40-AM-1024x342.png\" alt=\"\" class=\"wp-image-11695\" srcset=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2017\/09\/ChatGPT-Image-Sep-12-2026-11_47_40-AM-1024x342.png 1024w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2017\/09\/ChatGPT-Image-Sep-12-2026-11_47_40-AM-300x100.png 300w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2017\/09\/ChatGPT-Image-Sep-12-2026-11_47_40-AM-768x257.png 768w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2017\/09\/ChatGPT-Image-Sep-12-2026-11_47_40-AM-1536x513.png 1536w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2017\/09\/ChatGPT-Image-Sep-12-2026-11_47_40-AM-2048x684.png 2048w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">ERROR 1273 (HY000) at line 25:\nUnknown collation: 'utf8mb4_unicode_520_ci'<\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Understanding the Error<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Collations determine how text data is sorted and compared within a database. The collation <code>utf8mb4_unicode_520_ci<\/code> was introduced in newer versions of MySQL and may not be available in older versions.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">When a database dump created on a newer MySQL server is imported into an older server, MySQL cannot recognize the unsupported collation and terminates the import process.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Migration Flow<\/h3>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">Source Server (MySQL 5.7\/8.0)\n            \u2502\n            \u25bc\n      Database Dump\n            \u2502\n            \u25bc\nDestination Server (Older MySQL)\n            \u2502\n            \u25bc\nERROR 1273:\nUnknown collation\nutf8mb4_unicode_520_ci\n            \u2502\n            \u25bc\nReplace Collation\n      or\nUpgrade MySQL\n            \u2502\n            \u25bc\nSuccessful Import<\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Cause<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">This issue generally occurs because:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The source server uses a newer MySQL version.<\/li>\n\n\n\n<li>The destination server uses an older MySQL version.<\/li>\n\n\n\n<li>The SQL dump contains unsupported collations.<\/li>\n\n\n\n<li>The database is being migrated between different hosting environments.<\/li>\n\n\n\n<li>Character set and collation settings differ between servers.<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Resolution<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">To fix the issue, search the SQL dump file for all occurrences of:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">utf8mb4_unicode_520_ci<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">and replace them with:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">utf8mb4_unicode_ci<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Using the Replace Command<\/h3>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">replace utf8mb4_unicode_520_ci utf8mb4_unicode_ci -- mydump.sql<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Using Sed on Linux<\/h3>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sed -i 's\/utf8mb4_unicode_520_ci\/utf8mb4_unicode_ci\/g' mydump.sql<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Once the replacement is complete, import the database again.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Alternative Solution: Upgrade MySQL<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">If upgrading the destination server is possible, install a MySQL version that supports <code>utf8mb4_unicode_520_ci<\/code>. This is the preferred long-term solution because it maintains complete compatibility with the original database dump.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Best Practices for Future Database Migrations<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Verify MySQL versions on both servers before migration.<\/li>\n\n\n\n<li>Test database backups in a staging environment.<\/li>\n\n\n\n<li>Use consistent character sets and collations.<\/li>\n\n\n\n<li>Keep MySQL servers updated.<\/li>\n\n\n\n<li>Create a backup before modifying dump files.<\/li>\n\n\n\n<li>Document server configurations for future migrations.<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The <strong>ERROR 1273 (HY000): Unknown collation &#8216;utf8mb4_unicode_520_ci&#8217;<\/strong> is a common MySQL migration issue caused by version incompatibility between source and destination servers. Fortunately, the problem can be resolved quickly by replacing the unsupported collation with a compatible one or by upgrading the target MySQL version. Following proper migration practices can help prevent similar issues and ensure smooth database transfers.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Frequently Asked Questions (FAQ)<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">1. Why do I get the &#8220;Unknown collation utf8mb4_unicode_520_ci&#8221; error?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">This error occurs when a database dump created on a newer MySQL version is imported into an older MySQL server that does not support the <code>utf8mb4_unicode_520_ci<\/code> collation.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">2. Is it safe to replace <code>utf8mb4_unicode_520_ci<\/code> with <code>utf8mb4_unicode_ci<\/code>?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Yes. In most cases, replacing it is safe and allows the database import to complete successfully. There may be minor differences in text sorting behavior, but they rarely affect typical applications.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">3. How can I prevent this error in future migrations?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Use compatible MySQL versions on both source and destination servers, verify collations before exporting databases, and test imports in a staging environment before production deployment.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Related Articles<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/pheonixsolutions.com\/blog\/how-to-solve-404-not-found-error-while-accessing-subpages-on-website\/\">How to Solve 404 Not Found Error While Accessing Subpages on Website<br><\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/pheonixsolutions.com\/blog\/codeigniter-404-error-nginx\/\">How to Fix CodeIgniter 404 Error on Nginx<br><\/a><\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Talk to our experts<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Looking for the right technology solution for your business? Our team of experts can help you with development, cloud, DevOps, design, and a wide range of other technology needs. Get in touch with our team&nbsp;<a href=\"https:\/\/pheonixsolutions.com\/contact\" target=\"_blank\" rel=\"noreferrer noopener\">here<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction Database migrations are a routine task for developers, system administrators, and website owners. However, moving a MySQL database between [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[1022],"tags":[388,179],"class_list":["post-2132","post","type-post","status-publish","format-standard","hentry","category-web-architecture","tag-collation","tag-mysql-2","psol-cat-web-architecture"],"jetpack_publicize_connections":[],"jetpack_shortlink":"https:\/\/wp.me\/phn2x7-yo","jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/2132","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/comments?post=2132"}],"version-history":[{"count":1,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/2132\/revisions"}],"predecessor-version":[{"id":11696,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/2132\/revisions\/11696"}],"wp:attachment":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=2132"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=2132"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=2132"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}