問題
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