Ubuntu16.04.1安裝mysql的曲折過程

系統環境:Ubuntu16.04.1 server版。

測試有效的方法:

更改Ubuntu16原來的安裝源,不用自帶的安裝源。

wget http://dev.mysql.com/get/mysql-apt-config_0.8.1-1_all.deb

sudo dpkg -i mysql-apt-config_0.8.1-1_all.deb           (這一步可以選擇安裝版本)

sduo apt-get update

sudo apt-get install mysql-server

注:上面鏈接如果失效,請到 http://dev.mysql.com/downloads/repo/apt/ 自行下載之後執行後面三條命令即可。

wget http://dev.mysql.com/get/mysql-apt-config_0.7.3-1_all.deb

sudo dpkg -i mysql-apt-config_0.7.3-1_all.deb              (這個可以選擇老一點的版本)


參考:http://blog.csdn.net/yangbodong22011/article/details/52215791



遇到的問題:

開始直接用Ubuntu16自帶的源安裝的時候報錯:

update-alternatives: using /etc/mysql/mysql.cnf to provide /etc/mysql/my.cnf (my.cnf) in auto mode

mysql Renaming removed key_buffer and myisam-recover options (if present)

安裝到這裏就卡住了,參照這篇博文的方法試了幾次,卸載了重新安裝,但是似乎沒有效果。http://blog.csdn.net/flyfish111222/article/details/52808464

sudo apt-get autoremove mysql* --purge

sudo apt-get remove apparmor  

sudo rm /var/lib/mysql/ -R          //非常重要

sudo rm /etc/mysql/ -R               //非常重要

重啓電腦,再次利用命令sudo apt-get install mysql-server 安裝。




發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章