Ubuntu-手动安装MySQL5.7

2019-02-16 09:46:22   MySQL

ubuntu15.10, ubuntu14.04 安装MySQL5.7


更新源

备份源文件

sudo cp /etc/apt/sources.list   /etc/apt/sources.list-bk

修改sources.list文件

vim /etc/apt/ sources.list

修改为:

deb http://mirrors.aliyun.com/ubuntu/trusty main multiverse restricted universe  
deb http://mirrors.aliyun.com/ubuntu/trusty-backports main multiverse restricted universe  
deb http://mirrors.aliyun.com/ubuntu/trusty-proposed main multiverse restricted universe  
deb http://mirrors.aliyun.com/ubuntu/trusty-security main multiverse restricted universe  
deb http://mirrors.aliyun.com/ubuntu/trusty-updates main multiverse restricted universe  
deb-src http://mirrors.aliyun.com/ubuntu/trusty main multiverse restricted universe  
deb-src http://mirrors.aliyun.com/ubuntu/trusty-backports main multiverse restricted universe  
deb-src http://mirrors.aliyun.com/ubuntu/trusty-proposed main multiverse restricted universe  
deb-src http://mirrors.aliyun.com/ubuntu/trusty-security main multiverse restricted universe  
deb-src http://mirrors.aliyun.com/ubuntu/trusty-updates main multiverse restricted universe 

更新软件

sudo apt-get update

下载

地址:https://dev.mysql.com/downloads/mysql/

下载与系统对应的安装包,目前15.10的安装包消失了,列表中找不到,如果是ubuntu15.10的话,下载14.04也可以。


安装

解压

先进入到下载文件的目录

tar -xvf  mysql-server_5.7.20-1ubuntu14.04_amd64.deb-bundle.tar
# 注,这里的文件名以你下载的为准

升级并安装依赖

sudo apt-get upgrade
sudo apt-get install libaio1

按照顺序安装

因为有依赖关系,所以请按照顺序安装

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

执行修复安装

sudo apt-get -f install

安装server

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

设置密码

剩下的就是一直选择ok,然后输入密码什么的了。安装完成后就可以了。

vien.tech版权所有,允许转载,但转载请注明出处和原文链接: https://viencoding.com/article/81
欢迎小伙伴们在下方评论区留言 ~ O(∩_∩)O
文章对我有帮助, 点此请博主吃包辣条 ~ O(∩_∩)O

猜你喜欢


评论

There are no comments yet.
未登录

登录后即可发表评论

登录或注册

亲情非友情链接