[+/-]
You can install the Connector/J package using either the binary or
source distribution. The binary distribution provides the easiest
method for installation; the source distribution lets you
customize your installation further. With either solution, you
manually add the Connector/J location to your Java
CLASSPATH.
If you are upgrading from a previous version, read the upgrade information in Section 22.3.3.3, “Upgrading from an Older Version” before continuing.
Connector/J is also available as part of the Maven project. For more information, and to download the Connector/J JAR files, see the Maven repository.

User Comments
On Mac OSX 10.4, simply putting the connector/j in the /System/Library/Java/Extensions folder was not enough for me.
This command:
"Class.forName("com.mysql.jdbc.Driver").newInstance();"
would throw this error:
"Exception in thread "main" java.lang.NoClassDefFoundError: test/class"
After much pain, I set the classpath environment variable manually in the .profile file as follows:
PATH=${PATH}:/usr/local/mysql/bin
CLASSPATH=$CLASSPATH:/System/Library/Java/Extensions/
CLASSPATH=$CLASSPATH:/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Classes/:/Library/Java/Extensions/
export CLASSPATH
And all was well.
I had exactly the same problem and was pulling my hair out.
I am running OS X 10.4 on an Intel Mac.
My problem differed slightly in that copying the mysql-connector-java-5.0.3 folder (which is the download file) to the /system/library/java/extensions folder wasn't enough. I had to copy the mysql-connector-java-5.0.3-bin.jar out of the mysql-connector-java-5.0.3 folder and put it in extensions.
For some reason I don't understand it wasn't visible while in its enclosing folder.
I have spent hours trying to get this working but at least it's over now.
I don't think JVM search for all folders and files in the jar directory. It only look through the files in Extension folder.
I am having problem connecting mysql from Java. Error:
Exception in thread "main" java.lang.NoClassDefFoundError: org/aspectj/lang/Signature
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at mysqlConnEx.main(mysqlConnEx.java:19)
I am on Win7.
I tried to put the jar file in ext and also com and org folder there. but no one method has solved my problem. I spent many hours.
Finally solved. I have read everywhere but not here. The next page said about the file "mysql-connector-java-3.1.14-bin-g.jar". I read that putting the jar file "mysql-connector-java-3.1.14-bin.jar" is enough for Java mysql connection. but for some reason it was not working.
Another problem I have is that I have possibly downloaded 64-bit JDK but installed jre version is of 32-bit. So, I have two Jre installed. So for some reason putting file "mysql-connector-java-3.1.14-bin.jar" in C:\Program Files (x86)\Java\jre6\lib\ext\ was not working. So I have added dubug (1st file mentioned) to the ext folder.
But I finally removed "mysql-connector-java-3.1.14-bin-g.jar" from 32-bit jre folder. and not it is working.
We also cannot get it working Windows 7, 64bit MySQL 32
Any step by steps how we can add this to our ODBC connections?
if you have windows 7 and your jdbc driver is not connecting then you should find the mysql-connector-java-5.1.20-bin.jar in your program files x86 folder.(driver may be different version depending on when you download the driver)
if the program file x86 folder. then find mysql folder. then find you connector folder(my connector folder is connector J 5.1.20.0 yours may be different). next right click on the mysql-connector-java-5.1.20-bin.jar. chose cut then past the file to your desktop. Open netbeans I am using version 7.2. find the project you want to add this file to using the project explorer on the left hand side. right click on that project's libraries folder. click add jar/folder. click desktop on the left had side. find mysql-connector-java-5.1.20-bin. click open/add. now run your program.
Add your own comment.