问题
How do I install com.mysql.jdbc.Driver for Fedora17 O.S using jdk version 1.7 I always get an error of could not find Driver with class name:com.mysql.jdbc.Driver in all my jdbc codes.
回答1:
Assuming that you already have MySQL installed,
Install the connector driver. :
yum install libmysql-java
Then make sure that the classpath is set.
export CLASSPATH=$CLASSPATH:/usr/share/java/mysql-connector-java.jar
If you want to set this for all users, you should modify the
/etc/environment
instead
If you are using Eclipse, you can also do this by going through the following steps:
- Select
Project Properties > Java Build Path
- Select Libries tab
- Click Add External Jars
- Choose the jar file, in this case
mysql-connector-java.jar
来源:https://stackoverflow.com/questions/29138153/how-to-install-com-mysql-jdbc-driver