问题:在第三方用户登录和微信用户登录时,服务器报告了以下错误:SQL exception : incorrect string value : ' \ xf0 \ x9f \ x91 \ x8c ' for
检测到保存微信用户名错误。微信用户名包含特殊图标,报告了错误
解决方案:
1)在数据库中,将相应的字段编码更改为utf8- utf8mb4
2)通过修改a配置文件,将以下配置添加到中,可以解决问题
connectioninitsqls : ' set names utf8 mb4 '
a文件由以下内容组成:
服务器:
端口: 8000
弹簧:
Datasource:
Type:com.alibaba.druid .
Druid:
驱动程序-类-名称: com.my
URL : JDBC : MySQL ://127 . 0 . 0 . 1:3306/测试?allowmultiqueries=trueuseunicode=truecharacterencoding=utf-8 use SSL=false
Username :根
Password: 123456
Initial-size: 10
Max-active: 100
Min-idle: 10
最大值-wait : 60000
connectioninitsqls : ' set names utf8 mb4 '
pool-prepared-statements : true
max-pool-prepared-statement-per-connection-size 3360 20
time-between-eviction-runs-millis : 60000
min-evict able-idle-time-millis : 300000
Test-while-idle: true
Test-on-borrow:假
测试-on-return :假
stat-view-servlet :
Enabled: true
Url-pattern: /druid/*
Filter:
Stat:
Log-slow-sql: true
Slow-slow-sql-millis: 1000
Merge-sql: false
Wall:
Config:
Multi-statement-allow3360 true说明:关注微信公众号[村之一],回复“电子书”,回复[1],回复电子书[抛光设计模式]
这些电子书只用于学习,如果你喜欢,请买正版图书!请支持原创作家!