今天读取solr里面的数据,往mysql插入时报错, Incorrect string value: '\xF0\x9F\x93\x8D\xE8\x88...' for column 'title' at row 1 原因是标题有Emoj表情相关字符,因为我这边不需要保留Emoj表情,不需要复原显示,所以我选择了简单的方式,过滤字符. byte[] b_text=title3.getBytes(); for (int i = 0; i < b_text.length; i++) { if((b_
往MySQL插入数据时,报错如下 java.sql.SQLException: Incorrect at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:) at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:) at com.mysql.cj.jdbc.exceptions.SQLExceptionsMap
1.异常提示: 12:59:10.000 [http-nio-8080-exec-40] DEBUG o.s.j.s.SQLStateSQLExceptionTranslator - Extracted SQL state class 'HY' from value 'HY000' 12:59:10.000 [http-nio-8080-exec-40] DEBUG org.mybatis.spring.SqlSessionUtils - Closing non transactional Sq
(1366, "Incorrect string value: '\\xF0\\x9F\\x8E\\xAC\\xE5\\x89...' for column 'description' at row 1") 针对MySQL的这个错误, 修改方法是 set names utf8mb4; SET CHARACTER SET utf8mb4;SET character_set_connection=utf8mb4;
1.线上碰到个问题,端上切换搜狗输入法后,原来限制的表情符号还能输入.数据库使用的是5.7.22版本的,刚开始以为数据库不支持表情符号导致的,但是看了线上的数据库以及字段,都是支持的. show variables like '%character%'; show full columns from driver_reward_record; 直接使用sql语句通过navicate 客户端,也是可以插入成功的.但是在程序里面 死活插入不进去,这就郁闷了. 看了下mysql的 mysql-conn