首先:具体的安装步骤在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. [MySQL]InnoDB引擎的行锁和表锁

    1.行锁和表锁 在mysql 的 InnoDB引擎支持行锁,与Oracle不同,mysql的行锁是通过索引加载的,即是行锁是加在索引响应的行上的,要是对应的SQL语句没有走索引,则会全表扫描, 行锁则 ...

  2. Spring Cloud构建微服务架构(五)服务网关

    通过之前几篇Spring Cloud中几个核心组件的介绍,我们已经可以构建一个简略的(不够完善)微服务架构了.比如下图所示: 我们使用Spring Cloud Netflix中的Eureka实现了服务 ...

  3. Eleaticsearch源码分析(一)编译启动

    转自:https://lunatictwo.github.io/2017/12/21/Eleaticsearch%E6%BA%90%E7%A0%81%E5%88%86%E6%9E%90(%E4%B8% ...

  4. Gradle缓存目录文件命名规则

    在打开Android Studio项目的时候,会下载项目对应版本的gradle,该版本是在项目根目录下\gradle\wrapper\gradle-wrapper.properties文件中指定的: ...

  5. 在v-html中,js 正则表达式清除字符串里的style属性

    项目中遇到这样的需求,后端返回的是字符串,在vue用v-html显示,里面有style样式,要去除style 在v-html中使用filters,和平时的不一样,推荐项目的方法,定义一个全局的过滤方法 ...

  6. 纯CSS3轮播图

    <!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8" ...

  7. Confluence 6 配置推荐更新邮件通知默认的初始化设置

    Confluence 为订阅者发送常规邮件报告,这个邮件报告中包含有用户具有查看权限的空间的最新的内容.这个被称为 推荐更新(Recommended Updates)通知. 如果你具有 Conflue ...

  8. Confluence 6 选择一个默认的语言

    管理员可以设置应用到你 Confluence 站点所有空间的默认语言.请注意,一个独立的用户可以在他们自己的属性中选择他们独立的语言属性. 设定默认的语言 在 Confluence 站点中修改默认的语 ...

  9. pod 使用详解

    cd 进去到 项目目录 包含 xcodeproj 结尾的目录下 1 pod init 创建一个pod 文件 2 打开生产的pod 文件 然后 配置pod 文件 并保存  3 pod install 安 ...

  10. jquery 的鼠标事件/淡入淡出/绑定

    <!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8" ...