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

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM