Linux常用命令学习(二)

在 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到目标路径:

Linux常用命令学习(二)_第1张图片
cd /usr/local/src

2)、解压

tar -xf  mysql-server_5.7.20-1ubuntu14.04_amd64.deb-bundle.tar 

Linux常用命令学习(二)_第2张图片
解压后文件

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密码)

Linux常用命令学习(二)_第3张图片
设置密码

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

Linux常用命令学习(二)_第4张图片
安装完成

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

Linux常用命令学习(二)_第5张图片
安装成功

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

utf8设置

修改完成后重启mysql服务

/etc/init.d/mysql restart

2:检查安装设置

登录:mysql -u root -p

检查:status

Linux常用命令学习(二)_第6张图片
设置成功

参考资料:

http://blog.csdn.net/dst1213/article/details/52084379

http://blog.csdn.net/chenpy/article/details/50344085

http://www.cnblogs.com/tabCtrlShift/p/6564002.html

你可能感兴趣的:(Linux常用命令学习(二))