首页 > 代码库 > Mysql

Mysql

安装mysql 5.6

检查系统是否自带安装mysql

[root@10 ~]# yum list installed | grep mysql 
mysql.x86_64            5.1.73-5.el6_6  @anaconda-CentOS-201508042137.x86_64/6.7
mysql-devel.x86_64      5.1.73-5.el6_6  @anaconda-CentOS-201508042137.x86_64/6.7
mysql-libs.x86_64       5.1.73-5.el6_6  @anaconda-CentOS-201508042137.x86_64/6.7

发现有系统自带mysql,将其删除

[root@10 ~]#  yum -y remove mysql-libs.x86_64 

删除后可以再次检查是否还存在mysql

由于mysql的yum源服务器在国外,所以下载速度会比较慢,还好mysql5.6只有79M大,而mysql5.7就有182M了,所以这里想安装mysql5.6

[root@10 ~]# wget http://repo.mysql.com/mysql-community-release-el6-5.noarch.rpm

解压rpm 包(这个rpm还不是mysql的安装文件,只是两个yum源文件,执行后,在/etc/yum.repos.d/ 这个目录下多出mysql-community-source.repo和mysql-community.repo )

[root@10 ~]# rpm -ivh mysql-community-release-el6-5.noarch.rpm 

用yum repolist mysql这个命令查看一下是否已经有mysql可安装文件 

[root@10 ~]# yum repolist all | grep mysql
mysql-connectors-community MySQL Connectors Community enabled: 39
mysql-connectors-community-source MySQL Connectors Community - S disabled
mysql-tools-community MySQL Tools Community enabled: 49
mysql-tools-community-source MySQL Tools Community - Source disabled
mysql55-community MySQL 5.5 Community Server disabled
mysql55-community-source MySQL 5.5 Community Server - S disabled
mysql56-community MySQL 5.6 Community Server enabled: 377
mysql56-community-source MySQL 5.6 Community Server - S disabled
mysql57-community-dmr MySQL 5.7 Community Server Dev disabled
mysql57-community-dmr-source MySQL 5.7 Community Server Dev disabled

安装mysql 服务器

[root@10 ~]# yum install -y mysql-community-server

Mysql