英文:
Liquibase Windows MySQL - Cannot find database driver: com.mysql.cj.jdbc.Driver
问题
以下是翻译好的内容:
我正在PowerShell中运行以下命令,以便在CircleCI上执行,但是出现了错误:找不到数据库驱动程序:com.mysql.cj.jdbc.Driver
./liquibase.bat --driver=com.mysql.cj.jdbc.Driver
--classpath=E:\Software\liquibase-3.10.2\lib\mysql-connector-java-5.1.48.jar --url="jdbc:mysql://REDACTED:3306/sandbox"
--changeLogFile=/db.changelog-1.0.mysql.sql --username=REDACTED
--password=REDACTED `
generateChangeLog
我已经检查了mysql-connector文件的类路径是否正确/运行了一个文件存在性检查,结果为True
在检查了输出之后,PATH变量中包含了Liquibase根文件夹
$env:PATH
如果有任何指导意见,将不胜感激
谢谢
英文:
I am running the following command in Powershell with a view to get it on CircleCI but am seeing the error: Cannot find database driver: com.mysql.cj.jdbc.Driver
./liquibase.bat
--driver=com.mysql.cj.jdbc.Driver
--classpath=E:\Software\liquibase-3.10.2\lib\mysql-connector-java-5.1.48.jar
--url="jdbc:mysql://REDACTED:3306/sandbox"
--changeLogFile=/db.changelog-1.0.mysql.sql
--username=REDACTED
--password=REDACTED `
generateChangeLog
I have checked the classpath of the mysql-connector file being correct / ran a file exists and is True
[System.IO.File]::Exists('E:\Software\liquibase-3.10.2\lib\mysql-connector-java-5.1.48.jar')
The PATH variable has the Liquibase root folder after checking the output of
$env:PATH
Any pointers would be greatly appreciated
Thanks
答案1
得分: 6
将您的驱动程序更改为
--driver=com.mysql.jdbc.Driver
或更新您的MySQL依赖项。我相信您的依赖项具有com.mysql.jdbc
包,但是MySQL已经更新了他们的库,使用了新的包。
尝试使用这个作为示例。
英文:
Change your driver to
--driver=com.mysql.jdbc.Driver
or update your mysql dependency. I believe your dependency has package com.mysql.jdbc
but mysql updated their library with new package.
Try to use this one for example.
答案2
得分: 0
对我而言,在插件中添加了mysql的依赖后,它起作用了:
<plugin>
<groupId>org.liquibase</groupId>
<artifactId>liquibase-maven-plugin</artifactId>
<version>4.15.0</version>
<configuration>
<propertyFile>${liquibase.properties}</propertyFile>
</configuration>
<dependencies>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.26</version>
</dependency>
</dependencies>
</plugin>
英文:
For me, it worked when I added mysql dependency for the plugin:
<plugin>
<groupId>org.liquibase</groupId>
<artifactId>liquibase-maven-plugin</artifactId>
<version>4.15.0</version>
<configuration>
<propertyFile>${liquibase.properties}</propertyFile>
</configuration>
<dependencies>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.26</version>
</dependency>
</dependencies>
</plugin>
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论