数据库迁移导致Unknown character set: 'GBK' 应用异常
程序员文章站
2022-11-06 23:29:57
https://blog.csdn.net/u013415591/article/details/82692242https://blog.csdn.net/gx_1_11_real/article/details/81066336 迁移之前没这个问题,原来迁移后没将lower_case_table ......
https://blog.csdn.net/u013415591/article/details/82692242
https://blog.csdn.net/gx_1_11_real/article/details/81066336
迁移之前没这个问题,原来迁移后没将lower_case_table_names加上,mysql有点矫情,严格区分大小写。。。
12:08:19,494 [error]-[com.alibaba.druid.filter.logging.log4jfilter statementlogerror 152]-{conn-10088, pstmt-169279} execute error. select t.region_id, t.region_name, t.region_name_en, t.region_code2, t.region_code3 from t_region t where t.is_black = 0 and t.parent_id = ? order by t.sort_order, convert(trim(t.region_name_en) using gbk) asc
com.mysql.jdbc.exceptions.jdbc4.mysqlsyntaxerrorexception: unknown character set: 'gbk'
vi /etc/my.cnf
增加
lower_case_table_names=1
service mysqld start