1、下载连接器驱动
http://124.254.47.43/download/43203122/63155544/1/gz/14/149/1367574471182_917/mysql-connector-java-5.1.25.tar.gz
2、解压缩驱动
tar zxvf /tmp/mysql-connector-java-5.1.25.tar.gz -C /
3、拷贝驱动JAR到Tomcat的lib中
cp /mysql-connector-java-5.1.25/mysql-connector-java-5.1.25-bin.jar /tomcat/lib/
4、更新/etc/profile
vim /etc/profile
export CATALINA_HOME=/tomcat
export CLASSPATH=$CLASSPATH:$CATALINA_HOME/tomcat/lib/mysql-connector-java-5.1.25-bin.jar
5、书写程序
原文地址:http://7737197.blog.51cto.com/7727197/1664549