21:15:50.614 [http-nio-8080-exec-10] ERROR c.r.f.w.e.GlobalExceptionHandler - [handleServiceException,61] - 导入失败:
### Error updating database. Cause: java.sql.SQLException: Incorrect string value: '\xE5\xAD\xA6\xE7\xA7\x91...' for column 'column_comment' at row 1
### The error may exist in file [/Users/jingzhe/WEB/msbd002/RuoYi-Vue-master/ruoyi-generator/target/classes/mapper/generator/GenTableColumnMapper.xml]
### The error may involve com.ruoyi.generator.mapper.GenTableColumnMapper.insertGenTableColumn-Inline
### The error occurred while setting parameters
### SQL: insert into gen_table_column ( table_id, column_name, column_comment, column_type, java_type, java_field, is_pk, is_increment, is_required, is_insert, is_edit, is_list, is_query, query_type, html_type, sort, create_by, create_time )values( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, sysdate() )
### Cause: java.sql.SQLException: Incorrect string value: '\xE5\xAD\xA6\xE7\xA7\x91...' for column 'column_comment' at row 1
; uncategorized SQLException; SQL state [HY000]; error code [1366]; Incorrect string value: '\xE5\xAD\xA6\xE7\xA7\x91...' for column 'column_comment' at row 1; nested exception is java.sql.SQLException: Incorrect string value: '\xE5\xAD\xA6\xE7\xA7\x91...' for column 'column_comment' at row 1
com.ruoyi.common.exception.ServiceException: 导入失败:
### Error updating database. Cause: java.sql.SQLException: Incorrect string value: '\xE5\xAD\xA6\xE7\xA7\x91...' for column 'column_comment' at row 1
### The error may exist in file [/Users/jingzhe/WEB/msbd002/RuoYi-Vue-master/ruoyi-generator/target/classes/mapper/generator/GenTableColumnMapper.xml]
### The error may involve com.ruoyi.generator.mapper.GenTableColumnMapper.insertGenTableColumn-Inline
### The error occurred while setting parameters
### SQL: insert into gen_table_column ( table_id, column_name, column_comment, column_type, java_type, java_field, is_pk, is_increment, is_required, is_insert, is_edit, is_list, is_query, query_type, html_type, sort, create_by, create_time )values( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, sysdate() )
### Cause: java.sql.SQLException: Incorrect string value: '\xE5\xAD\xA6\xE7\xA7\x91...' for column 'column_comment' at row 1
; uncategorized SQLException; SQL state [HY000]; error code [1366]; Incorrect string value: '\xE5\xAD\xA6\xE7\xA7\x91...' for column 'column_comment' at row 1; nested exception is java.sql.SQLException: Incorrect string value: '\xE5\xAD\xA6\xE7\xA7\x91...' for column 'column_comment' at row 1
at com.ruoyi.generator.service.GenTableServiceImpl.importGenTable(GenTableServiceImpl.java:194)
在使用系统工具----代码生成----导入SQL报错
可以执行以下SQL解决报错
-- 修改表字符集
ALTER TABLE gen_table_column CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
-- 修改字段字符集
ALTER TABLE gen_table_column MODIFY column_comment VARCHAR(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;