- This topic is empty.
- AuthorPosts
-
February 22, 2017 at 7:23 am #10678
shishil-patel
ParticipantI have a WordPress website on my local WAMP server. But when I upload its database to live server, I get error
#1273 – Unknown collation: ‘utf8mb4_unicode_520_ci’
February 22, 2017 at 7:26 am #10700savani-sandip
ParticipantYou can solve this by finding
ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci;
in your
.sql
file, and swapping it withENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
May 22, 2017 at 9:15 am #10701sabba-keynejad
ParticipantI believe this error is caused because the local server and live server are running different versions of MySQL. To solve this:
- Open the sql file in your text editor
- Find and replace all
utf8mb4_unicode_520_ci
withutf8mb4_unicode_ci
- Save and upload to a fresh mySql db
July 3, 2017 at 3:21 am #10699sherylhohman
ParticipantIn my case it turns out my
new server was runningMySQL 5.5
,
old server was runningMySQL 5.6
.
So I got this error when trying to import the.sql
file I’d exported from my old server.MySQL 5.5 does not support
utf8mb4_unicode_520_ci
, but
MySQL 5.6 does.Updating to
MySQL 5.6
on the new server solved collation the error !If you want to retain MySQL 5.5, you can:
– make a copy of your exported.sql
file
– replace instances ofutf8mb4unicode520_ci
andutf8mb4_unicode_520_ci
…withutf8mb4_unicode_ci
– import your updated.sql
file.February 17, 2018 at 6:08 am #10695shakil-hossain
Participantjust remove “520_”
utf8mb4_unicode_520_ci
→utf8mb4_unicode_ci
March 4, 2018 at 8:22 am #10698vuub
ParticipantOpen the sql file in your text editor;
1. Search: utf8mb4_unicode_ci Replace: utf8_general_ci (Replace All)
2. Search: utf8mb4_unicode_520_ci Replace: utf8_general_ci (Replace All)
3. Search: utf8mb4 Replace: utf8 (Replace All)
Save and upload!
April 6, 2018 at 5:37 am #10690nur-uddin
Participantfind and replace:
utf8mb4_unicode_520_ci
with
utf8_general_ci
in whole sql file
June 29, 2018 at 5:05 am #10696ryabinin-sergey
Participanteasy replace
sed -i 's/utf8mb4_unicode_520_ci/utf8mb4_unicode_ci/g' your_sql_file.sql
November 5, 2018 at 5:44 am #10685obmerk-kronen
ParticipantLate to the party, but in case this happens with a
WORDPRESS
installation :#1273 - Unknown collation: 'utf8mb4_unicode_520_ci
In phpmyadmin, under
export method
>Format-specific options
( custom export )Set to :
MYSQL40
If you will try to import now, you now might get another error message :
1064 - You have an error in your SQL syntax; .....
That is because The older
TYPE
option that was synonymous withENGINE
was removed in MySQL 5.5.Open your
.sql
file , search and replace all instancesfrom
TYPE=
toENGINE=
Now the import should go smoothly.
June 24, 2019 at 7:27 am #10692mushfiqur-rahman
ParticipantGetting collation error #1273 – Unknown collation: ‘utf8mb4_unicode_520_ci’ is caused by the difference of the MySQL version from which you export and our MySQL server to which you import. Basically, the WordPress library for newer version checks to see what version of SQL your site is running on. If it uses MySQL version 5.6 or more, it assumes the use of a new and improved Unicode Collation Algorithm (UCA) called “utf8mb4_unicode_520_ciâ€. This is great unless you end up moving your WordPress site from a newer 5.6 version of MySQL to an older, pre 5.6 version of MySQL.
To resolve this you will either have to edit your SQL export file and do a search and replace, changing all instances of ‘utf8mb4_unicode_520_ci’ to ‘utf8mb4_unicode_ci’. Or follow the steps below if you have a PHPMyAdmin:
- Click the Export tab for the database
- Click the Custom radio button.
- Go the section titled Format-specific options and change the drop-down for Database system or older MySQL server to maximize output compatibility with: from NONE to MYSQL40.
- Scroll to the bottom and click GO.
July 22, 2019 at 5:57 am #10694code-spy
ParticipantI just opened the dump.sql file in Notepad++ and hit CTRL+H to find and replace the string “utf8mb4_unicode_520_ci” and replaced it with “utf8mb4_general_ci“. Source link https://www.freakyjolly.com/resolved-when-i-faced-1273-unknown-collation-utf8mb4_unicode_520_ci-error/
November 13, 2019 at 7:32 am #10691achu
ParticipantIn my case I substitute it with
utf8_general_ci
with sed like this:sed -i 's/utf8mb4_unicode_520_ci/utf8_general_ci/g' MY_DB.sql sed -i 's/utf8mb4_unicode_520_ci/utf8_general_ci/g' MY_DB.sql
After that, I can import it without any issue.
September 24, 2020 at 4:01 am #10688herman
ParticipantI solved it this way, I opened the .sql file in a Notepad and clicked CTRL + H to find and replace the string "utf8mb4_unicode_520_ci" and replaced it with "utf8mb4_general_ci".
April 7, 2021 at 7:33 am #10679ahmednawazbutt
ParticipantI simply removed the
COLLATE
and other attributes and left only tillENGINE
.
like the followingFROM:
ENGINE=InnoDB AUTO_INCREMENT=429 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci
TO:
ENGINE=InnoDB;
and it worked for me just fine.
May 17, 2021 at 4:48 am #10680hexhad
Participant1273 – Unknown collation: ‘utf8mb4_unicode_520_ci’
in my case I was unable to import DB using
ENGINE = InnoDB AUTO_INCREMENT = 1 DEFAULT CHARSET = utf8 COLLATE = utf8_general_ci;
and
ENGINE = InnoDB AUTO_INCREMENT = 1 DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_520_ci;
both. But changing it to this in .SQL File resolved the problem
ENGINE=InnoDB DEFAULT CHARSET=latin1;
UPDATED
using ‘utf8mb4_general_ci‘resolved the problem
ENGINE = InnoDB AUTO_INCREMENT = 1 DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci;
- AuthorPosts
- You must be logged in to reply to this topic.