date: 2017-07-03
使用 *.dev 包安装 MySQL 5.7
特点:方便快捷
0,系统版本:
$ 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,官网下载软件包
在此地址选择适合相应系统版本的软件包 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,安装(如果报错,根据提示安装对应的依赖包)
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