在 Ubuntu 14.04 下安装 mysql 5.7.20
mysql官网:http://dev.mysql.com/downloads/mysql
1:下载安装包
选择系统版本Ubuntu14.04后缀名为deb_bundle.tar的进行下载
https://cdn.mysql.com//Downloads/MySQL-5.7/mysql-server_5.7.20-1ubuntu14.04_amd64.deb-bundle.tar
2:解压
1)、cd到目标路径:
2)、解压
tar -xf mysql-server_5.7.20-1ubuntu14.04_amd64.deb-bundle.tar
3、终端命令安装
1:准备工作:更新依赖源及安装libaio1依赖
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install libaio1
2:安装顺序
sudo dpkg -i mysql-common_5.7.20-1ubuntu14.04_amd64.deb
sudo dpkg-preconfigure mysql-community-server_5.7.20-1ubuntu14.04_amd64.deb( 此步需要输入数据的root密码)
sudo dpkg -i libmysqlclient20_5.7.20-1ubuntu14.04_amd64.deb
sudo dpkg -i libmysqlclient-dev_5.7.20-1ubuntu14.04_amd64.deb
sudo dpkg -i libmysqld-dev_5.7.20-1ubuntu14.04_amd64.deb
sudo dpkg -i mysql-community-client_5.7.20-1ubuntu14.04_amd64.deb
sudo dpkg -i mysql-client_5.7.20-1ubuntu14.04_amd64.deb
sudo dpkg -i mysql-common_5.7.20-1ubuntu14.04_amd64.deb
sudo dpkg -i libmysqlclient-dev_5.7.20-1ubuntu14.04_amd64.deb
sudo dpkg -i libmysqld-dev_5.7.20-1ubuntu14.04_amd64.deb
sudo dpkg -i mysql-community-client_5.7.20-1ubuntu14.04_amd64.deb
sudo dpkg -i mysql-client_5.7.20-1ubuntu14.04_amd64.deb
sudo dpkg -i mysql-common_5.7.20-1ubuntu14.04_amd64.deb
3:安装依赖包
sudo apt-get -f install
sudo apt-get -f install libmecab2
4:安装mysql-server
sudo dpkg -i mysql-community-server_5.7.20-1ubuntu14.04_amd64.deb
sudo dpkg -i mysql-server_5.7.20-1ubuntu14.04_amd64.deb
4、检测安装及配置
1:utf-8设置
编辑文件 vi /etc/mysql/my.cnf 增加以下内容:
#以下是utf-8的设置
[client]
default-character-set = utf8
[mysqld]
default-storage-engine = INNODB
character-set-server = utf8
collation-server = utf8_general_ci
[mysql]
default-character-set=utf8
修改完成后重启mysql服务
/etc/init.d/mysql restart
2:检查安装设置
登录:mysql -u root -p
检查:status
参考资料:
http://blog.csdn.net/dst1213/article/details/52084379