刪除mysql
sudo apt-get autoremove --purge mysql-server-5.0
sudo apt-get remove mysql-server
sudo apt-get autoremove mysql-server
sudo apt-get remove mysql-common //這個很重要
清理殘留數據
dpkg -l |grep ^rc|awk '{print $2}' |sudo xargs dpkg -P
重新安裝
sudo apt-get install mysql-server
安裝mysql
#sudo apt-get install mysql-server
#sudo apt-get install mysql-client
安裝jdbc
#sudo apt-get install libmysql-java
或手動下載 jdbc
http://dev.mysql.com/downloads/connector/j/5.1.html
下載解壓後,將mysql-connector-java-*.jar 複製到
java environment路徑 /usr/share/java/底下
並指將mysql.jar與mysql-connector-java.jar 都指向 mysql-connector-java-*.jar
CLASSPATH=".:/usr/share/java/mysql.jar"
設定
CLASSPATH=$CLASSPATH:/usr/share/java/mysql.jar
export CLASSPATH