silence-boot icon indicating copy to clipboard operation
silence-boot copied to clipboard

sql/silence-new.sql 表名大小写导致异常的问题

Open weisong82 opened this issue 5 years ago • 0 comments

mysql 的lower_case_table_names =0 时候,会抛异常:

Caused by: java.sql.SQLSyntaxErrorException: Table 'ry.QRTZ_LOCKS' doesn't exist

解决方法: 修改参数:lower_case_table_names 设置1,不区分大小写。 需要注意两点: 1,修改此参数会造成数据库重启 2,您需要核实下实例下的库,表是否都是小写,否则修改会报错。 查大写的库表名: select table_schema,table_name from information_schema.tables where table_schema not in("mysql","information_schema") and (md5(table_name)<>md5(lower(table_name)) or md5(table_schema)<>md5(lower(table_schema))); 查看大写的库名 select SCHEMA_NAME from information_schema.SCHEMATA where md5(SCHEMA_NAME)<>md5(lower(SCHEMA_NAME));

weisong82 avatar May 20 '20 13:05 weisong82