概述
20-Aug-2021 17:59:15.065 严重 [Druid-ConnectionPool-Create-1942040900] com.alibaba.druid.pool.DruidDataSource.error create connection SQLException, url: jdbc:mysql://localhost:3306/book, errorCode 0, state S1000
java.sql.SQLException: Unknown initial character set index '255' received from server. Initial client character set can be forced via the 'characterEncoding' property.
方法一:由于版本各种问题,字符集不统一,在连接数据库的URL指定字符集
url=jdbc:mysql://localhost:3306/book?characterEncoding=UTF-8
方法二:
发生这个错误的时候,一个可能是mysql jar包连接数据库的版本过低,字符集发生改变,换个高版本的mysql-connector-java
最后
以上就是无聊手链为你收集整理的error create connection SQLException,Unknown initial character set index ‘255‘ received from server.的全部内容,希望文章能够帮你解决error create connection SQLException,Unknown initial character set index ‘255‘ received from server.所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复