java.sql.SQLException: Unknown initial character set index &

时间:2022-05-16 06:52:42

解决方案:

  1. 首先查看数据库的版本号,删除旧的jar包,将mysql-connector-java.jar更换成对应版本号
    java.sql.SQLException: Unknown initial character set index &
  2. 同时在连接数据库的url后加上?useUnicode=true&characterEncoding=utf-8
    java.sql.SQLException: Unknown initial character set index &