#1273 – Unknown collation: ‘utf8mb4_unicode_520_ci’

前端 未结 12 1215
孤街浪徒
孤街浪徒 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 16:55

    In my case I substitute it with utf8_general_ci with sed like this:

    sed -i 's/utf8_0900_ai_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.

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

    I solved it this way, I opened the .sql file in a Notepad and clicked CTRL + H to find and replace the string "utf8mb4_0900_ai_ci" and replaced it with "utf8mb4_general_ci".

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

    I believe this error is caused because the local server and live server are running different versions of MySQL. To solve this:

    1. Open the sql file in your text editor
    2. Find and replace all utf8mb4_unicode_520_ci with utf8mb4_unicode_ci
    3. Save and upload to a fresh mySql db

    Hope that helpsenter image description here

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

    Open 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!

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

    You can solve this by finding

    ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci;
    

    in your .sql file, and swapping it with

    ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
    
    0 讨论(0)
  • 2020-11-30 17:09

    find and replace:

    utf8mb4_unicode_520_ci
    

    with

    utf8_general_ci
    

    in whole sql file

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