我可以从哪里下载 mysql jdbc jar?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/25546417/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-31 12:59:50  来源:igfitidea点击:

Where can I download mysql jdbc jar from?

mysqljdbcjar

提问by John Little

I installed and tried to use jasper report studio. The first brick wall you hit when you try to create a datasource for your reports is

我安装并尝试使用 jasper report studio。当您尝试为报告创建数据源时遇到的第一堵砖墙是

java.lang.ClassNotFoundException: com.mysql.jdbc.Driver

The forums say I need to install a jar on the classpath. I have no idea how to do this, so the first hurdle is how to get the jar. The only place I can find is this:

论坛说我需要在类路径上安装一个 jar。我不知道如何做到这一点,所以第一个障碍是如何获得罐子。我唯一能找到的地方是这样的:

http://dev.mysql.com/downloads/connector/j/

http://dev.mysql.com/downloads/connector/j/

but this unfortunately gives you an msi installer, not a jar. I don't want to install stuff, just get the jar.

但不幸的是,这为您提供了一个 msi 安装程序,而不是一个 jar。我不想安装东西,只需获取 jar。

I have mysql DB installed, had have trawled through the install dir in program files, but can't find the jar.

我已经安装了 mysql DB,已经在程序文件中搜索了安装目录,但找不到 jar。

Anyone know the official (not malware site) way to get hold of the mysql jar? It seems bizarre that its so hard to find.

任何人都知道获取 mysql jar 的官方(不是恶意软件站点)方式?很难找到,这似乎很奇怪。

I have windows 8 64 bit and mysql 5.6.

我有 Windows 8 64 位和 mysql 5.6。

回答by Prasad Khode

Go to http://dev.mysql.com/downloads/connector/jand with in the dropdown select "Platform Independent" then it will show you the options to download tar.gz file or zip file.

转到http://dev.mysql.com/downloads/connector/j并在下拉列表中选择“平台独立”,然后它将显示下载 tar.gz 文件或 zip 文件的选项。

Download zip file and extract it, with in that you will find mysql-connector-XXX.jarfile

下载 zip 文件并解压,在那里你会找到mysql-connector-XXX.jar文件

If you are using maven then you can add the dependency from the link http://mvnrepository.com/artifact/mysql/mysql-connector-java

如果您使用的是 maven,那么您可以从链接http://mvnrepository.com/artifact/mysql/mysql-connector-java添加依赖项

Select the version you want to use and add the dependency in your pom.xmlfile

选择您要使用的版本并在您的pom.xml文件中添加依赖项

回答by Roshith

If you have WL server installed, pick it up from under
\Oracle\Middleware\wlserver_10.3\server\lib\mysql-connector-java-commercial-5.1.17-bin.jar

如果您安装了 WL 服务器,请从
\Oracle\Middleware\wlserver_10.3\server\lib\mysql-connector-java-commercial-5.1.17-bin.jar 下选择它

Otherwise, download it from:
http://www.java2s.com/Code/JarDownload/mysql/mysql-connector-java-5.1.17-bin.jar.zip

否则,请从以下位置下载:http:
//www.java2s.com/Code/JarDownload/mysql/mysql-connector-java-5.1.17-bin.jar.zip

回答by ryenus

Here's a one-liner using Maven:

这是使用 Maven 的单行:

mvn dependency:get -Dartifact=mysql:mysql-connector-java:5.1.38

Then, with default settings, it's available in:

然后,使用默认设置,它可用于:

$HOME/.m2/repository/mysql/mysql-connector-java/5.1.38/mysql-connector-java-5.1.38.jar

Just replace the version number if you need a different one.

如果您需要不同的版本号,只需更换版本号。