How to install com.mysql.jdbc.Driver

亡梦爱人 提交于 2019-12-12 01:48:01

问题


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,

  1. Install the connector driver. : yum install libmysql-java

  2. 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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!