Mysql error ERROR 1273 (HY000) : Unknown collation: ‘utf8mb4_unicode_520_ci’ solved

Windows Articles

How to activate the automatic screen saver in Windows 10

Hello! Undoubtedly the time we spend in front of a computer has grown lately. In fact, in these times of pandemic, more...

How to install Teamviewer on Ubuntu 20.04?

Hi, folks. This will be a short and very simple post in which you will learn how to install TeamViewer on Ubuntu...

OpenSUSE 15.2 available

Well, another one has come into the family. A new version of OpenSUSE has recently been released. The community distribution under the...

How to install and configure Vagrant in Windows 10

Hello! Vagrant is a free, multi-platform command-line tool, which makes it easy to create reproducible and shareable development environments. Additionally, it creates...

Ubuntu Rolling Release? It is possible with Rolling Rhino

Throughout the Linux community, there are always expectations about when Ubuntu decides to have a Rolling Release. This, at least, since the...
Avatar
Mel Khamlichi
Webmaster and technical Director at Osradar.com Linux/Unix Guru Technology and hardware addicted Location : Amsterdam Netherlands

In my daily tests, i was testing to restore mysql database from debian9 to centos7. its not really cool because the version release of mysql on Debian is higher then Centos,

i did small research and found the solution, and i though maybe its fine to share it with people in this blog.

The Problem:

[root@localhost ~]# mysql -u root -p osradar < osradar.sql
Enter password:
ERROR 1273 (HY000) at line 25: Unknown collation: 'utf8mb4_unicode_520_ci'

Some times you  get this error :

1273 - Unknown collation: 'utf8mb4_unicode_ci'

Solution:

Please follow the bellow steps:

[root@localhost ~]# sed -i 's/utf8mb4/utf8/g' osradar.sql
[root@localhost ~]# sed -i 's/utf8_unicode_ci/utf8_general_ci/g' osradar.sql
[root@localhost ~]# sed -i 's/utf8_unicode_520_ci/utf8_general_ci/g' osradar.sql

osradar.sql is my MySQL database

Restore the Database now

[root@localhost ~]# mysql -u root -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 23
Server version: 5.5.56-MariaDB MariaDB Server

Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> use osradar;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
MariaDB [osradar]> show tables;
+------------------------+
| Tables_in_osradar |
+------------------------+
| wp_commentmeta |

Please share your experience with this solution on the comments bellow.

More articles

1 COMMENT

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest article

How to activate the automatic screen saver in Windows 10

Hello! Undoubtedly the time we spend in front of a computer has grown lately. In fact, in these times of pandemic, more...

How to install Teamviewer on Ubuntu 20.04?

Hi, folks. This will be a short and very simple post in which you will learn how to install TeamViewer on Ubuntu...

OpenSUSE 15.2 available

Well, another one has come into the family. A new version of OpenSUSE has recently been released. The community distribution under the...

How to install and configure Vagrant in Windows 10

Hello! Vagrant is a free, multi-platform command-line tool, which makes it easy to create reproducible and shareable development environments. Additionally, it creates...

Ubuntu Rolling Release? It is possible with Rolling Rhino

Throughout the Linux community, there are always expectations about when Ubuntu decides to have a Rolling Release. This, at least, since the...