我是靠谱客的博主 无聊手链,这篇文章主要介绍error create connection SQLException,Unknown initial character set index ‘255‘ received from server.,现在分享给大家,希望可以做个参考。

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内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(141)

评论列表共有 0 条评论

立即
投稿
返回
顶部