在MySQL官网上下载最新版的Ubuntu Linux专用的MySQL。我这里下载的是:
mysql-server_5.7.17-1ubuntu16.04_amd64.deb-bundle.tar
也可从以下mirrors下载:
http://mirrors.sohu.com/mysql/MySQL-5.7/
解压文件 命令为:
解压开来后,一共有11个deb包,用sudo dpkg -i [包名]命令逐个安装,因为包与包中间存在依赖关系,这里安装有个先后顺序。
-rw-r--r-- 1 7155 31415 841472 Nov 28 05:50 libmysqlclient20_5.7.17-1ubuntu16.04_amd64.deb
-rw-r--r-- 1 7155 31415 1189512 Nov 28 05:50 libmysqlclient-dev_5.7.17-1ubuntu16.04_amd64.deb
-rw-r--r-- 1 7155 31415 17383814 Nov 28 05:50 libmysqld-dev_5.7.17-1ubuntu16.04_amd64.deb
-rw-r--r-- 1 7155 31415 12644 Nov 28 05:50 mysql-client_5.7.17-1ubuntu16.04_amd64.deb
-rw-r--r-- 1 7155 31415 71282 Nov 28 05:50 mysql-common_5.7.17-1ubuntu16.04_amd64.deb
-rw-r--r-- 1 7155 31415 6815 Nov 28 05:50 mysql-community_5.7.17-1ubuntu16.04_amd64.changes
-rw-r--r-- 1 7155 31415 7357222 Nov 28 05:50 mysql-community-client_5.7.17-1ubuntu16.04_amd64.deb
-rw-r--r-- 1 7155 31415 24698654 Nov 28 05:50 mysql-community-server_5.7.17-1ubuntu16.04_amd64.deb
-rw-r--r-- 1 7155 31415 133305884 Nov 28 05:50 mysql-community-source_5.7.17-1ubuntu16.04_amd64.deb
-rw-r--r-- 1 7155 31415 23384678 Nov 28 05:50 mysql-community-test_5.7.17-1ubuntu16.04_amd64.deb
-rw-r--r-- 1 7155 31415 12636 Nov 28 05:50 mysql-server_5.7.17-1ubuntu16.04_amd64.deb
-rw-r--r-- 1 7155 31415 12652 Nov 28 05:50 mysql-testsuite_5.7.17-1ubuntu16.04_amd64.deb
我的安装的顺序是:
1.mysql-common_5.7.17-1ubuntu16.04_amd64.deb
2.libmysqlclient20_5.7.17-1ubuntu16.04_amd64.deb
3.libmysqlclient-dev_5.7.17-1ubuntu16.04_amd64.deb
4.libmysqld-dev_5.7.17-1ubuntu16.04_amd64.deb
5.mysql-community-client_5.7.17-1ubuntu16.04_amd64.deb
6.mysql-client_5.7.17-1ubuntu16.04_amd64.deb
7.mysql-community-source_5.7.17-1ubuntu16.04_amd64.deb
这里需要再安装一个依赖包叫libmecab2,安装好后,继续安装最后一个:
8.mysql-community-server_5.7.17-1ubuntu16.04_amd64.deb
安装过程中需要设置数据库密码。
到这里,所有的已经安装完毕。输入Mysql -u root -p可以登陆数据库了。
root@ubuntu:/fly/mysql# dpkg -i mysql-common_5.7.17-1ubuntu16.04_amd64.deb
dpkg: warning: downgrading mysql-common from 5.7.17-1ubuntu16.10 to 5.7.17-1ubuntu16.04
新闻热点
疑难解答