mysql的blob字段存储中文,输出乱码

1.mysql数据库连接字符编码
url ="jdbc:mysql://localhost:3306/test3?useUnicode=true&characterEncoding=UTF-8";

2.查看创表的字符集
show create table tablename;
3.查看数据库的编码
show variables like '%char%';

[img]https://img-blog.csdn.net/20170312153042389?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvdTAxMjQxMDczMw==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast[/img]
修改字符编码:

set character_set_server=utf8;
set character_set_database=utf8;
show variables like '%char%';

你可能感兴趣的:(mysql)