“Incorrect string value” when trying to insert UTF-8 into MySQL via JDBC?

前端 未结 18 1151
无人及你
无人及你 2020-11-22 07:51

This is how my connection is set:
Connection conn = DriverManager.getConnection(url + dbName + \"?useUnicode=true&characterEncoding=utf-8\", userName, password

18条回答
  •  无人共我
    2020-11-22 08:02

    I also had to drop and re-create all the database’s stored procedures (and functions too) in order that they execute within the new character set of utf8mb4.

    Run:

    SHOW PROCEDURE STATUS;
    

    …to see which procedures have not been updated to the server’s new character_set_client, collation_connection and Database Collation values.

提交回复
热议问题