date: 2017-07-03
使用 *.dev 包安裝 MySQL 5.7
特點:方便快捷
0厅各,系統(tǒng)版本:
$ cat /etc/os-release
NAME="Ubuntu"
VERSION="16.04.2 LTS (Xenial Xerus)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 16.04.2 LTS"
VERSION_ID="16.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
VERSION_CODENAME=xenial
1曹阔,官網(wǎng)下載軟件包
在此地址選擇適合相應系統(tǒng)版本的軟件包 https://dev.mysql.com/downloads/mysql/
找到后,可使用 wget 下載:
wget https://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-server_5.7.18-1ubuntu16.04_amd64.deb-bundle.tar
2穗慕,安裝依賴:
libaio1 libmecab2
查找版本及下載安裝:
apt-cache search libaio
apt-get install libaio1
apt-cache search libmecab
sudo apt-get install libmecab2
3遵绰,解壓
shell> tar -xvf mysql-server_5.7.18-1ubuntu16.04_amd64.deb-bundle.tar
4逝变,預配置(按要求配置 root 密碼)
shell> sudo dpkg-preconfigure mysql-community-server_*.deb
5,安裝(如果報錯膛堤,根據(jù)提示安裝對應的依賴包)
shell> sudo dpkg -i mysql-{common,community-client,client,community-server,server}_*.deb
6手趣,If you are being warned of unmet dependencies by dpkg, you can fix them using apt-get:
sudo apt-get -f install
7,安裝的文件:
All configuration files (like my.cnf) are under /etc/mysql
All binaries, libraries, headers, etc., are under /usr/bin and /usr/sbin
The data directory is /var/lib/mysql
參考:https://dev.mysql.com/doc/refman/5.7/en/linux-installation-debian.html