1. 程式人生 > >ubuntu 安裝mysql環境(離線壓縮包方式)

ubuntu 安裝mysql環境(離線壓縮包方式)

1,Ubuntu 14.04 安裝 64位的 MySQL 5.7.9
到官網 http://dev.mysql.com/downloads/mysql/ 下載
Ubuntu Linux 14.04 (x86, 64-bit), DEB Bundle
(檔名: mysql-server_5.7.9-1ubuntu14.04_amd64.deb-bundle.tar)

2,放在 /home/soft/ 下解壓:

cd /home/soft/
sudo chmod +x mysql-server_5.7.9-1ubuntu14.04_amd64.deb-bundle.tar
tar -xvf mysql-server_5.7.9-1ubuntu14.04_amd64.deb-bundle.tar(不可用-zxvf,否則不能解壓)

3,解壓出以下檔案:

libmysqlclient20_5.7.9-1ubuntu14.04_amd64.deb

libmysqlclient-dev_5.7.9-1ubuntu14.04_amd64.deb

libmysqld-dev_5.7.9-1ubuntu14.04_amd64.deb  

mysql-community-client_5.7.9-1ubuntu14.04_amd64.deb

mysql-community-server_5.7.9-1ubuntu14.04_amd64.deb      

mysql-community-source_5.7.9-1ubuntu14.04_amd64.deb

mysql-client_5.7.9-1ubuntu14.04_amd64.deb         

mysql-community-test_5.7.9-1ubuntu14.04_amd64.deb

mysql-common_5.7.9-1ubuntu14.04_amd64.deb         

mysql-server_5.7.9-1ubuntu14.04_amd64.deb

mysql-community_5.7.9-1ubuntu14.04_amd64.changes  

mysql-testsuite_5.7.9-1ubuntu14.04_amd64.deb

4,更新設定到最新系統:
sudo apt-get update
sudo apt-get upgrade
apt-get install libaio1

5,然後分別安裝以下的包:
sudo dpkg -i mysql-common_5.7.9-1ubuntu14.04_amd64.deb
sudo mysql-community-server_5.7.9-1ubuntu14.04_amd64.deb
此步需要輸入資料的root密碼

sudo dpkg -i libmysqlclient20_5.7.9-1ubuntu14.04_amd64.deb
sudo dpkg -i libmysqlclient-dev_5.7.9-1ubuntu14.04_amd64.deb
sudo dpkg -i libmysqld-dev_5.7.9-1ubuntu14.04_amd64.deb
sudo dpkg -i mysql-community-client_5.7.9-1ubuntu14.04_amd64.deb
sudo dpkg -i mysql-client_5.7.9-1ubuntu14.04_amd64.deb
sudo dpkg -i mysql-common_5.7.9-1ubuntu14.04_amd64.deb

sudo apt-get -f install
5,此步為了安裝依賴包 libmecab2

sudo dpkg -i mysql-community-server_5.7.9-1ubuntu14.04_amd64.deb
sudo dpkg -i mysql-server_5.7.9-1ubuntu14.04_amd64.deb

6,這時資料安裝完成,並自動啟動


7,檢視mysql安裝的路徑和依賴:

whereis mysql

mysql: /usr/bin/mysql /etc/mysql /usr/lib/mysql /usr/include/mysql /usr/share/mysql /usr/share/man/man1/mysql.1.gz

這時你會發現 mysql以服務形式自啟動