java.sql.SQLException: Unknown initial character set index '255' received from server for connector 8.0.11

后端 未结 14 1785
再見小時候
再見小時候 2021-02-14 22:13

While establishing the connection to a MySQL database, I\'m getting the following error

java.sql.SQLException: Unknown initial character set index \'255\' receiv         


        
14条回答
  •  面向向阳花
    2021-02-14 22:45

    I am using springboot,liquibase, mysql

    I got solution: This error occur just because of mysql connector in dependency and mysql server you install not match(in my case i am using lower version mysql connector and latest mysql server). So just change scope of mysql connector to runtime:

    maven

        
            mysql
            mysql-connector-java
            runtime
        
    

    gradle

    dependencies {
    //... other dependencies
    runtimeOnly group:'mysql', name:'mysql-connector-java'
    }
    

    Or if problem yet not solve then use same version or nearby version for both mysql server and mysql connector.

提交回复
热议问题