When exporting data from HDFS Data Import Mysql, encountered emoji expression default problem of dirty data

Datax introducing emoji expression shown as dirty mysql

antecedent:

Mysql character encoding the build table has been adjusted, the local insert is added to it, but is shown as imported using datax dirty.

Error message:

Here Insert Picture Description
Here Insert Picture Description

Solution:

- Modify the mysql configuration file

vim /etc/my.cnf

- add the following in the configuration file
[Client]
default-Character-SET = utf8mb4
[MySQL]
default-Character-SET = utf8mb4
[mysqld]
Character-SET-Server = utf8mb4
collation-Server = utf8mb4_unicode_ci
init_connect = 'the SET NAMES utf8mb4'

- Restart mysqld service
systemctl restart mysqld.service

- try again
Here Insert Picture Description

note:

After successful import the client may not show up, adjust your client's display or update the client Oh!

Published 24 original articles · won praise 0 · Views 1044

Guess you like

Origin blog.csdn.net/Answer2333333/article/details/104791641