首先:具体的安装步骤在mysql官方文档上都有详细的描述。

文档虽然是英文,不过很容易理解,我就不一一翻译了。

官方文档地址:https://dev.mysql.com/doc/refman/5.6/en/linux-installation-yum-repo.html

目前mysql最新版本为:5.7.x

但因为5.7版本比之前版本改动比较大,所以项目中一般还是在用5.6版本。

1、Adding the MySQL Yum Repository

  Go to the Download MySQL Yum Repository page (http://dev.mysql.com/downloads/repo/yum/) in the MySQL Developer Zone.

  因为centos版本是7.x,至于为什么是mysql57-community-release-el7-11.noarch.rpm,文档中有如下解释:

  The repository packages available below will provide MySQL Server 5.7 by default. Other versions can be obtained by editing the repo setup file installed by the package.

yum localinstall mysql57-community-release-el7-.noarch.rpm

ps:如何卸载 yum localinstall

# 先查看已经安装的rpm包
rpm -qa|grep mysql
mysql-libs-5.1.-.el6_8.x86_64
mysql80-community-release-el7-.noarch # 卸载上一步得到的两个rpm包
yum remove mysql-libs-5.1.-.el6_8.x86_64
yum remove mysql80-community-release-el7-.noarch

You can check that the MySQL Yum repository has been successfully added by the following command:

yum repolist enabled | grep "mysql.*-community.*"

Selecting a Release Series

vim /etc/yum.repos.d/mysql-community.repo

# Specify enabled= to disable a subrepository,or enabled= to enable a subrepository.
# Enable to use MySQL 5.6
[mysql56-community]
name=MySQL 5.6 Community Server
baseurl=http://repo.mysql.com/yum/mysql-5.6-community/el/6/$basearch/
enabled=
gpgcheck=
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

You should only enable subrepository for one release series at any time. When subrepositories for more than one release series are enabled, the latest series will be used by Yum.

Verify that the correct subrepositories have been enabled and disabled by running the following command and checking its output:

yum repolist enabled | grep mysql

2、Install MySQL by the following command:

yum install mysql-community-server

如果你只想安装mysql client或者mysqldump等,可执行如下命令

yum install mysql-community-client

Start the MySQL server with the following command:

systemctl start mysqld.service

Check the status of the MySQL server with the following command:

systemctl status mysqld.service

 3、安装后的mySql配置文件位置

/etc/my.cnf

有问题欢迎留言交流。

技术交流群:282575808

--------------------------------------

声明: 原创文章,未经允许,禁止转载!

--------------------------------------

Centos7使用yum命令安装Mysql5.6.X的更多相关文章

  1. CentOS7使用yum命令安装Java1.8

    CentOS7使用yum命令安装Java1.8 首先更新已安装的包:#yum update查看系统当前的java版本:#java -version==================== CentOS ...

  2. CentOS7下yum方式安装mysql5.6

    在Centos7中用MariaDB代替了mysql数据库.所以在新安装MySQL前必须做好对系统的清理工作. 一.清理CentOS7下的MariaDB. [root@localhost ~]#rpm ...

  3. CentOS7 使用yum命令安装Java SDK(openjdk)

    CentOS 6.X 和 7.X 自带有OpenJDK runtime environment  (openjdk).它是一个在linux上实现开源的java 平台. 安装方式: 1.输入以下命令,以 ...

  4. centos7下yum方式安装MySQL5.7

    前言: MySQL作为一款免费.开源数据库产品,已经问世就饱受关注,很多中小企业甚至是大企业都钟爱MySQL,随着大数据的不断发展,我们接触的信息量也越来越多,虽然NoSQL是大数据的宠儿,但MySQ ...

  5. Linux CentOS7通过yum命令安装Mono(尝先安装模式)

    前言 经过尝试网上各种安装mono的技术贴,这个安装过程经历了大约2周,尝试了各个版本,几目前博客所描述的所有安装方式.以下内容的安装方式可以为你尝试不同版本的mono.并非正式环境安装标准方式安装. ...

  6. Centos7 通过yum命令安装jdk1.8

    直接安装,不看原因 yum install java-1.8.0-openjdk* -y 1 分割线上下之选一个看即可. —————————————华丽的分割线—————————————— 先查看系统 ...

  7. Centos7 用yum命令安装LAMP环境(php+Apache+Mysql)以及php扩展

    1.yum -y update    // 更新系统 1.1)yum -y install gcc g++ gcc-c++ make kernel-devel kernel-headers 1.2)v ...

  8. CentOS7系统yum方式安装MySQL5.7

    参考:https://www.cnblogs.com/bigbrotherer/p/7241845.html#top 1.在CentOS中默认安装有MariaDB,这个是MySQL的分支,但为了需要, ...

  9. centos7使用yum方式安装MySQL5.7

    yum -y localinstall http://mirrors.ustc.edu.cn/mysql-repo/mysql57-community-release-el7.rpm yum inst ...

随机推荐

  1. [加密算法]为什么说RSA难以被破解

    RSA算法运用了数学“两个大的质数相乘,难以在短时间内将其因式分解”的这么一套看似简单事实上真的是很困难的一个数学难题...... 以前也接触过RSA加密算法,感觉这个东西太神秘了,是数学家的事,和我 ...

  2. zxing源码编译与运行

    编译的jar文件下载地址:http://files.cnblogs.com/rainboy2010/zxing.zip zxing是一个开源的解析条形码/二维码的类库,广泛应用于Android 各大A ...

  3. 如何创建一个标准的Windows服务

    出处:http://www.cnblogs.com/wuhuacong/archive/2009/02/11/1381428.html 如何创建一个标准的Windows服务 在很多时候,我们需要一个定 ...

  4. Confluence 6 SQL Server 数据库驱动修改

    从 Confluence 6.4 开始,我们使用官方的 Microsoft SQL Server JDBC 驱动来替换掉开源的 jTDS 驱动.从这个版本开始所有的安装都会默认使用官方的 Micros ...

  5. mongo数据库的各种查询语句示例

    左边是mongodb查询语句,右边是sql语句.对照着用,挺方便. db.users.find() select * from users db.users.find({"age" ...

  6. 对Swoole、Workerman和php自带的socket的理解

    为什么php自带的socket不怎么听说,基本都是用swoole,workerman去实现? 1.PHP的socket扩展是一套socket api,仅此而已. swoole,用C实现,它的socke ...

  7. IO伪异步实现

    伪异步的实现,通过多线程,也会阻塞,等待连接 1.创建TcpServer类 package com.cppdy.tcp; import java.io.IOException; import java ...

  8. D3.js force力导向图用指定的字段确定link的source和target,默认是索引

    json.links.forEach(function (e) { var sourceNode = json.nodes.filter(function (n) { return n.name == ...

  9. 二.Rsync备份服务

    自己动手部署一遍 期中架构-第二章-备份服务笔记====================================================================== 01. 课 ...

  10. Web Penetration Testing

    1.国外使用的一款在线工具,对web的信息收集很有帮助 地址http://archive.org  , WayBack Machine 主界面如下:对百度存档的历史信息进行查询. 2.IP地址归属信息 ...