首先:具体的安装步骤在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. Android瀑布流优化,解决Recyclerview展示大批量图片时Item自动切换、闪烁、空白等问题

    本文涉及的代码案例可以在下方的链接中找到,如果对你有帮助,请给个Star(#^.^#) https://github.com/CodeTillDoom/StaggeredRcl 问题分析 这段时间业务 ...

  2. 任意N位二进制的补码实现——队列存放

    正在学习计算机组织与结构,为了写一些底层的算术操作模拟,比如一个二进制补码数的加减乘除,发现这很麻烦,因为不管是什么语言,都只提供了8位.32.64位等部分位数的补码形式,那么怎么实现任意任意位的补码 ...

  3. Inspector did not run successfully.

    装虚拟机,卡在这个报错1天了, server没有问题,其余所有的agent都不能运行. 这部分没有日志,只有单纯的报错信息,omg,百度.bing一顿骚操作,还是没有解决问题. 因为默认安装jdk1. ...

  4. (转载)(int)a、&a、(int)&a、(int&)a的区别,很偏僻的题

    #include <iostream>#include <stdio.h>#include <string.h>#include <conio.h>us ...

  5. C#简单画图程序

    实现过程: (1) 新建窗体应用程序 (2) 添加一个MenuScrip控件:添加一个ToolScrip控件. 在ToolScrip控件中对每个单元,要将DisplayStyle属性改为Text (3 ...

  6. js获取参数函数

  7. 【MySql】delete用法

    delete 语句用于删除表中的数据, 基本用法为: delete from 表名称 where 删除条件; 以下是在表 students 中的实例: 删除 id 为 3 的行: delete fro ...

  8. Windows Server 2016 + SCO 2016 安装及配置介绍

    Windows Server 2016 + SCO 2016 安装及配置介绍 高文龙关注1人评论6332人阅读2017-02-26 23:23:02 Windows Server 2016 + SCO ...

  9. 【docker】私有仓库搭建

    主要参考:http://blog.csdn.net/gqtcgq/article/details/51163558 假设我们在1.1.1.1:5000上搭建私人仓库,并在2.2.2.2上访问这个私人仓 ...

  10. Linux编程学习笔记(一)

    Linux的发展趋势势在必行,国内的服务器的操作系统Linux占到主导地位,不光是操作系统,还有嵌入式系统. 1. 今天就Linux的其中一个版本做一介绍,如下是Centos的版本之间的区别. ins ...