mysql中的表情符号变成问号 [英] Emoji's in mysql turns to question marks

查看:1371
本文介绍了mysql中的表情符号变成问号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图将表情符号插入到mysql中,但是它变成了问号,我更改了mysql连接服务器排序规则,数据库排序规则,表排序规则和列排序规则.我用这些来改变物品

I am trying to insert emoji's into mysql but it turns to question marks, I have changed mysql connection server collation, database collation , table collation and column collation. I used these to change the items

# For each database:
ALTER DATABASE database_name CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci;
# For each table:
ALTER TABLE table_name CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
# For each column:
ALTER TABLE table_name CHANGE column_name column_name VARCHAR(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

我完成了所有这些操作,但是mysql中的表情符号仍然显示问号.请我该怎么做才能使mysql显示表情符号.预先感谢

I have done all these but emoji's in mysql still show question marks. Please what should I do to make mysql show the emojis. Thanks in advance

推荐答案

回答问题的时间太晚了.但我希望它对其他人有用...

Little late to answer the question. But I hope it will be useful for others...

以上配置使数据库表存储utf8编码的数据.但是,数据库连接(JDBC)应该能够将utf8编码的数据传输到客户端.为此,应将JDBC连接参数字符集设置为 utf8mb4 .

Above configuration makes the database tables to store utf8 encoded data. But, the database connection(JDBC) should be able to transfer the utf8 encoded data to client. For that the JDBC connection parameter charset should be set to utf8mb4.

这篇关于mysql中的表情符号变成问号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆