MySQL - Debug - 表名大小写识别问题 java.sql.SQLSyntaxErrorException: Table ‘xxxxxxxx.QRTZ_LOCKS‘ doesn‘t exist
问题
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'jobController': Unsatisfied dependency expressed through field 'jobService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jobServiceImpl': Invocation of init method failed; nested exception is org.quartz.impl.jdbcjobstore.LockException: Failure obtaining db row lock: xxxxxx.QRTZ_LOCKS' doesn't exist [See nested exception: java.sql.SQLSyntaxErrorException: Table 'xxxxxxx.QRTZ_LOCKS' doesn't exist]
mysql数据库中,有qrtz_locks,但是报错显示找不到QRTZ_LOCKS表。。。推测是表名大小写不识别的问题
解决方案
本人用docker安装mysql, 在初始运行mysql容器里时,已经做了数据卷:
docker run -p 3306:3306 --name mysql \
-v /mydata/mysql/log:/var/log/mysql \
-v /mydata/mysql/data:/var/lib/mysql \
-v /mydata/mysql/conf:/etc/mysql \
-e MYSQL_ROOT_PASSWORD=root \
-d mysql:5.7
因此可以在mysql容器外(也就是Linux主机上的 /mydata/mysql/conf)找到配置文件my.cnf
并增加一条lower_case_table_names = 1
然后重启容器即可
————————————————
版权声明:本文为CSDN博主「龙城烟雨」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/qq_40215763/article/details/107577960
posted on 2021-08-17 21:34 frank_cui 阅读(1123) 评论(0) 编辑 收藏 举报