Ubuntu16.04完全離線安裝mysql
申明:本部落格的行文思路和大致內容轉載自http://www.cnblogs.com/JasonTech0713/p/6690949.html
與轉載部落格的區別在於,本部落格屬於在完全無網路下安裝及配置mysql,包括依賴包的安裝和相關包的下載連結
一、在官網下載mysql
官網地址:https://dev.mysql.com/downloads/mysql/
因為我的電腦是64位ubuntu16.04,因此我下載的版本是:
mysql-server_5.7.18-1ubuntu16.04_amd64.deb-bundle.tar
二、解壓
tar –xvf mysql-server_5.7.18-1ubuntu16.04_amd64.deb-bundle.tar
得到以下檔案:
libmysqlclient20_5.7.18-1ubuntu16.04_amd64.deb
libmysqlclient-dev_5.7.18-1ubuntu16.04_amd64.deb
libmysqld-dev_5.7.18-1ubuntu16.04_amd64.deb
mysql-client_5.7.18-1ubuntu16.04_amd64.deb
mysql-common_5.7.18-1ubuntu16.04_amd64.deb
mysql-community-client_5.7.18-1ubuntu16.04_amd64.deb
mysql-community-server_5.7.18-1ubuntu16.04_amd64.deb
mysql-community-source_5.7.18-1ubuntu16.04_amd64.deb
mysql-community-test_5.7.18-1ubuntu16.04_amd64.deb
mysql-server_5.7.18-1ubuntu16.04_amd64.deb
mysql-testsuite_5.7.18-1ubuntu16.04_amd64.deb
三、安裝所需的包
1. sudo dpkg –i mysql-common_5.7.18-1ubuntu16.04_amd64.deb
2. sudo dpkg-preconfigure –i mysql-community-server_5.7.18-1ubuntu16.04_amd64.deb
輸入root密碼,即設定資料庫初始密碼
3. sudo dpkg –i libmysqlclient20_5.7.18-1ubuntu16.04_amd64.deb
4. sudo dpkg –i libmysqlclient-dev_5.7.18-1ubuntu16.04_amd64.deb
5. sudo dpkg –i libmysqld-dev_5.7.18-1ubuntu16.04_amd64.deb
6. sudo dpkg –i mysql-community-client_5.7.18-1ubuntu16.04_amd64.deb
注意:安裝此步驟需要libaio1依賴包,安裝包程式在文末已提供
7. sudo dpkg –i mysql-client_5.7.18-1ubuntu16.04_amd64.deb
8. sudo dpkg –i mysql-common_5.7.18-1ubuntu16.04_amd64.deb
9. sudo dpkg –i mysql-community-server_5.7.18-1ubuntu16.04_amd64.deb
注意:安裝此步驟需要libmecab2依賴包,安裝包程式在文末已提供
10. sudo dpkg –i mysql-server_5.7.18-1ubuntu16.04_amd64.deb
四、安裝完成 檢視路徑和依賴whereis mysql
mysql --version
六、登入
mysql -u 使用者名稱 –p
Enter password:[輸入設定的初始密碼]
七、修改安裝過程中的root初始密碼
在mysql系統外,使用mysqladmin
#mysqladmin –u root –p password “123456”
八、依賴包連結
http://pan.baidu.com/s/1hsoqRfm