JDBC连接数据库时出现问题 java.sql.SQLException: Unknown initial character set index ‘255‘ received from server

JDBC连接数据库时出现问题

报错:java.sql.SQLException: Unknown initial character set index '255' received from server. Initial client character set can be forced via the 'characterEncoding' property.
在这里插入图片描述

在连接数据库时增加编码

在添加编码之前用’?'隔开

添加:useUnicode=true&characterEncoding=utf8
JDBC连接数据库时出现问题 java.sql.SQLException: Unknown initial character set index ‘255‘ received from server_第1张图片

测试连接数据库成功

JDBC连接数据库时出现问题 java.sql.SQLException: Unknown initial character set index ‘255‘ received from server_第2张图片

你可能感兴趣的:(数据库,数据库,java,mysql)