#1273 – Unknown collation: ‘utf8mb4_unicode_520_ci’

前端 未结 12 1216
孤街浪徒
孤街浪徒 2020-11-30 16:27

I have a WordPress website on my local WAMP server. But when I upload its database to live server, I get error

#1273 – Unknown collation: ‘         


        
相关标签:
12条回答
  • 2020-11-30 17:11

    Getting 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:

    1. Click the Export tab for the database
    2. Click the Custom radio button.
    3. 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.
    4. Scroll to the bottom and click GO.
    0 讨论(0)
  • 2020-11-30 17:12

    Late 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 with ENGINE was removed in MySQL 5.5.

    Open your .sql file , search and replace all instances

    from TYPE= to ENGINE=

    Now the import should go smoothly.

    0 讨论(0)
  • 2020-11-30 17:15

    easy replace

    sed -i 's/utf8mb4_unicode_520_ci/utf8mb4_unicode_ci/g' your_sql_file.sql
    
    0 讨论(0)
  • 2020-11-30 17:16

    In my case it turns out my
    new server was running MySQL 5.5,
    old server was running MySQL 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 of utf8mb4unicode520_ci and utf8mb4_unicode_520_ci
    ...with utf8mb4_unicode_ci
    - import your updated .sql file.

    0 讨论(0)
  • 2020-11-30 17:17

    I just opened the dump.sql file in Notepad++ and hit CTRL+H to find and replace the string "utf8mb4_0900_ai_ci" and replaced it with "utf8mb4_general_ci". Source link https://www.freakyjolly.com/resolved-when-i-faced-1273-unknown-collation-utf8mb4_0900_ai_ci-error/

    0 讨论(0)
  • 2020-11-30 17:19

    just remove "520_"
    utf8mb4_unicode_520_ciutf8mb4_unicode_ci

    0 讨论(0)
提交回复
热议问题