首页 > 网名大全 正文
微信登录名字不符怎么办、微信添加银行卡名字不符怎么办

时间:2023-03-22 21:59:29 阅读: 评论: 作者:佚名

问题:在做第三方用户登录,对接微信用户登录时,服务器报了如下错误,SQLException:Incorrect string value:'\xF0\X9F\X91\X8C' for column 'real_name' 。

发现是微信用户名保存错误,该微信用户名包含了特殊图标,报错了

解决方案:

1)在数据库中把对应的字段编码修改为utf8-> utf8mb4

2)修改a配置文件,在中添加如下配置,问题得到解决

connectionInitSqls: "set names utf8mb4"

a文件配置如下:

server: port: 8000 spring: datasource: type: com.alibaba.druid. druid: driver-class-name: com.my url: jdbc:mysql://127.0.0.1:3306/test?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false username: root password: 123456 initial-size: 10 max-active: 100 min-idle: 10 max-wait: 60000 connectionInitSqls: "set names utf8mb4" pool-prepared-statements: true max-pool-prepared-statement-per-connection-size: 20 time-between-eviction-runs-millis: 60000 min-evictable-idle-time-millis: 300000 test-while-idle: true test-on-borrow: false test-on-return: false stat-view-servlet: enabled: true url-pattern: /druid/* filter: stat: log-slow-sql: true slow-sql-millis: 1000 merge-sql: false wall: config: multi-statement-allow: true

说明:关注微信公众号【村中一少】,回复“电子书”按照提示信息获取对应书籍目录序号,如回复【1】,即可获得电子书【研磨设计模式.陈臣.王斌.扫描版.pdf】下载地址,所有电子均为免费。

这些电子书仅仅用于学习,如果喜欢请购买正版图书!请支持原版作者!

  • 评论列表

发表评论: