Quarkus连接MySQL时数据库版本不匹配问题求助
Quarkus连接数据库版本不匹配报错解决方法
Persistence unit '
' was configured to run with a database version of at least '8.0.0', but the actual version is '5.5.0'. Consider upgrading your database. Alternatively, rebuild your application with 'quarkus.datasource.db-version=5.5.0' (but this may disable some features and/or impact performance negatively)
方法一:升级数据库版本
- 直接将数据库版本升级到8.0.0及以上,完全匹配Quarkus应用的默认配置要求,既能保留所有特性,也能保证最佳性能。
方法二:修改Quarkus配置适配旧数据库
- 在应用的配置文件中添加对应配置,适配当前5.5.0版本的数据库:
- 若使用
application.properties:quarkus.datasource.db-version=5.5.0 - 若使用
application.yml:quarkus: datasource: db-version: 5.5.0
- 若使用
- 注意:此方式会禁用Quarkus针对高版本数据库优化的部分特性,可能对应用性能产生负面影响,仅在无法升级数据库时采用。
内容的提问来源于stack exchange,提问作者Umesh
相关产品推荐
相关产品推荐

