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

前端 未结 18 939
无人及你
无人及你 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:01

    Assuming you are using phpmyadmin to solve this error, follow these steps:

    1. phpMyAdmin
    2. your_table
    3. "Structure tab"
    4. change the Collation of your field from latin1_swedish_ci (or whatever it is) to utf8_general_ci

提交回复
热议问题