官网下载链接在
http://cdn.mysql.com//Downloads/MySQL-5.7/mysql-server_5.7.13-1ubuntu14.04_amd64.deb-bundle.tar
成功下载后有文件 mysql-server_5.7.13-1ubuntu14.04_amd64.deb-bundle.tar
解压
tar -xvf mysql-server_5.7.13-1ubuntu14.04_amd64.deb-bundle.tar
有12个文件
更新设置到最新系统:
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install libaio1
此步为了安装依赖包 libaio1
因为包与包中间存在依赖关系,这里安装有个先后顺序。然后分别安装以下的包:
sudo dpkg -i mysql-common_5.7.9-1ubuntu14.04_amd64.deb
sudo dpkg-preconfigure mysql-community-server_5.7.9-1ubuntu14.04_amd64.deb
此步需要输入数据的root密码
sudo dpkg -i libmysqlclient20_5.7.9-1ubuntu14.04_amd64.deb
sudo dpkg -i libmysqlclient-dev_5.7.9-1ubuntu14.04_amd64.deb
sudo dpkg -i libmysqld-dev_5.7.9-1ubuntu14.04_amd64.deb
sudo dpkg -i mysql-client_5.7.9-1ubuntu14.04_amd64.deb
sudo dpkg -i mysql-community-client_5.7.9-1ubuntu14.04_amd64.deb
sudo dpkg -i mysql-common_5.7.9-1ubuntu14.04_amd64.deb
sudo apt-get install libmecab2
此步为了安装依赖包 libmecab2
sudo dpkg -i mysql-community-server_5.7.9-1ubuntu14.04_amd64.deb
sudo dpkg -i mysql-server_5.7.9-1ubuntu14.04_amd64.deb
这时mysql数据安装完成,并自动启动
开启: sudo /etc/init.d/mysql start
关闭: sudo /etc/init.d/mysql stop
重启: sudo /etc/init.d/mysql restart
状态: sudo service mysql status
到这里,所有的已经安装完毕。输入Mysql -uroot-p可以登陆数据库了。