1.更新ubuntu的軟件列表
$
sudo apt-get uptate
![](http://static.javashuo.com/static/loading.gif)
PS:使用update更新軟件時出現忽略、獲取、命中。
hint,命中 表示連接上這個網站
get獲取 表示有更新而且下載,
ign忽略 表示無更新或者更新可有可無或者不須要
get獲取 表示有更新而且下載,
ign忽略 表示無更新或者更新可有可無或者不須要
2.更新ubuntu的軟件
$
sudo apt-get upgrade
![](http://static.javashuo.com/static/loading.gif)
3.安裝MySQL server
$
sudo apt-get install mysql-server
![](http://static.javashuo.com/static/loading.gif)
MySQL server卸載命令:
$
sudo apt-get autoremove mysql-server
4.在安裝MySQL server時讓設置MySQL server 的密碼
![](http://static.javashuo.com/static/loading.gif)
再次輸入密碼
![](http://static.javashuo.com/static/loading.gif)
5.安裝MySQL client
$
sudo apt-get install mysql-client
![](http://static.javashuo.com/static/loading.gif)
MySQL client卸載命令:
$
sudo apt autoremove mysql-client
6.安裝libmysqlclient-dev
$
sudo apt-get install libmysqlclient-dev
![](http://static.javashuo.com/static/loading.gif)
libmysqlclient-dev卸載命令:
$
sudo apt autoremove libmysqlclient-dev
7.查看mysql是否安裝成功,若是有MySQL進程則安裝成功
$
sudo netstat -tap |grep mysql
![](http://static.javashuo.com/static/loading.gif)
8.進入MySQL
$
mysql -uroot -p
![](http://static.javashuo.com/static/loading.gif)