腾讯云CentOS7使用yum安装mysql的问题_丁永辉的博客-程序员秘密

技术标签: yum  安装教程  腾讯云  mysql  centos  

一、问题简单描述

腾讯云CentOS7在用yum安装mysql时,参考mysql的官方文档安装(见最后的附录),出现了这样的问题:
这里写图片描述

二、原因:

  1. Go to the Download MySQL Yum Repository page in the MySQL Developer Zone.
    mysql的yun源下载地址

  2. Select and download the release package for your platform.
    这里写图片描述

  3. Install the downloaded release package with the following command
    (1)下载完成后,用SSH Secure File Transfer Client等工具将下载的rpm包上传到云服务器上。接着进入到mysql57-community-release-el7-9.noarch.rpm包所在的文件夹,执行下面的命令:
    [root@ centos local]# sudo rpm -Uvh mysql57-community-release-el7-9.noarch.rpm
    (2)之后,进入yum源的配置文件夹:
    [root@ centos local]# cd /etc/yum.repos.d/
    [root@ centos local]# ls
    会发现,多出了两个mysql的yun源配置
    这里写图片描述
    备注:yum的配置一般有两种方式,一种是直接配置/etc目录下的yum.conf文件,另外一种是在/etc/yum.repos.d目录下增加.repo文件。

  4. 问题来了
    安装了mysql的yum源后,整个yum源都出了问题。
    (1)例如:执行
    [root@ centos local]#yum repolist all | grep mysql
    会出现下面图中的问题
    这里写图片描述
    (2)执行下面命令,安装的是其他软件包,仍然出现同样的问题。推测一下,应该是该mysql的yum源有问题,导致了整个yum源出错了。
    [root@ centos local]#yum install libaio
    同样也会出现下面图中的问题
    这里写图片描述

  5. 总结:腾讯云CentOS7用yum源安装mysql的方法行不通

三、解决方法

分两个步骤:一是删除已配置mysql的yum源;二是用tar方法安装mysql(详细看我的另一篇文章)
1. 删除刚刚配置的mysql的yum源
[root@ centos yum.repos.d]# yum remove mysql57-community-release-el7-9.noarch

  1. 进入yum源的配置文件夹,查看一下
    [root@ centos local]# cd /etc/yum.repos.d/
    [root@ centos local]# ls
    可以发现,mysql的yum源别删除了:
    这里写图片描述

  2. 此时再次安装其他软件包,可以看到恢复正常了。
    这里写图片描述

  3. 接下来,可以用tar的方式安装mysql了。以下是我的另一篇博文:腾讯云CentOS7使用tar安装mysql
    http://blog.csdn.net/qq_24891153/article/details/52763369

附录:linux上用yum安装mysql的官方文档摘录

Linux上用yum安装mysql的官方文档地址

A Quick Guide to Using the MySQL Yum Repository

Abstract

The MySQL Yum repository provides RPM packages for installing the MySQL server, client, and other components on Linux platforms. The packages also upgrade and replace any third-party MySQL packages installed from the Linux distros’ native software repositories, if replacements for them are available from MySQL.

The MySQL Yum repository supports the following Linux platforms :

EL5-, EL6-, and EL7-based platforms (for example, the corresponding versions of Red Hat Enterprise Linux, Oracle Linux, and CentOS)

Fedora 23 and 24

This is a quick guide to using the MySQL Yum repository. For more information, see Further Readings.

For legal information, see the Legal Notices.

For help with using MySQL, please visit either the MySQL Forums or MySQL Mailing Lists, where you can discuss your issues with other MySQL users.

For additional documentation on MySQL products, including translations of the documentation into other languages, and downloadable versions in variety of formats, including HTML and PDF formats, see the MySQL Documentation Library.

Document generated on: 2016-10-05 (revision: 49311)

Steps for a Fresh Installation of MySQL

Note:
The following instructions assume that MySQL is not already installed on your system using a third-party-distributed RPM package; if that is not the case, follow the instructions given in Replacing a Native Third-Party Distribution of MySQL.

1、Adding the MySQL Yum Repository
First, add the MySQL Yum repository to your system’s repository list. Follow these steps:

Go to the download page for MySQL Yum repository at http://dev.mysql.com/downloads/repo/yum/.

Select and download the release package for your platform.

Install the downloaded release package with the following command, replacing platform-and-version-specific-package-name with the name of the downloaded package:

shell> sudo rpm -Uvh platform-and-version-specific-package-name.rpm
For example, for version n of the package for EL6-based systems, the command is:

shell> sudo rpm -Uvh mysql57-community-release-el6-n.noarch.rpm
Note
Once the release package is installed on your system, any system-wide update by the yum update command (or dnf upgrade for dnf-enabled systems) will automatically upgrade MySQL packages on your system and also replace any native third-party packages, if Yum finds replacements for them in the MySQL Yum repository. See Upgrading MySQL with the MySQL Yum Repository and Replacing a Native Third-Party Distribution of MySQL for details.

2、Selecting a Release Series
When using the MySQL Yum repository, the latest GA release of MySQL is selected for installation by default. If this is what you want, you can skip to the next step, Installing MySQL with Yum.

Within the MySQL Yum repository (http://repo.mysql.com/yum/), different release series of the MySQL Community Server are hosted in different subrepositories. The subrepository for the latest GA series (currently MySQL 5.7) is enabled by default, and the subrepositories for all other series (for example, the MySQL 5.6 series) are disabled by default. Use this command to see all the subrepositories in the MySQL Yum repository, and see which of them are enabled or disabled (for dnf-enabled systems, replace yum in the command with dnf):

shell> yum repolist all | grep mysql

3、Installing MySQL

Install MySQL by the following command (for dnf-enabled systems, replace yum in the command with dnf):

shell> sudo yum install mysql-community-server
This installs the package for the MySQL server, as well as other required packages.

4、Starting the MySQL Server

Start the MySQL server with the following command:

shell> sudo service mysqld start
You can check the status of the MySQL server with the following command:

shell> sudo service mysqld status

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/qq_24891153/article/details/52763134

智能推荐

智能多媒体内容设计在阿里巴巴的应用_alibbfb_Kun Li的博客-程序员秘密

http://idi.zju.edu.cn/wp-content/uploads/2020/11/59a1dff68908308effc05fb811f9b0ed.pdfhttp://idi.zju.edu.cn/wp-content/uploads/2020/11/59a1dff68908308effc05fb811f9b0ed.pdf淘宝网 - 淘!我喜欢 https://alidesign.taobao.com/work.htm#/iframe/wantoo

Enterprise:Elastic Workplace 搜索:随时随地搜索所有内容 (二)_search application_Elastic 中国社区官方博客的博客-程序员秘密

这篇文章是我之前的文章“Solutions:Elastic workplace 搜索:随时随地搜索所有内容 (一)”的续篇。在上一篇文章中,我们讲述了什么是Elastic Workplace 搜索就如果安装和部署它。我们已经展示了Elastic Workplace在Dropbox里强大的搜索能力。在今天的这篇文章,我们接着展示如何搜索github里的文件。添加github源我们可以通...

php markdown html,HTML 与 Markdown 互相转换_weixin_39870664的博客-程序员秘密

引入以下工具进行 markdown 与 html 之间的转换.App\Http\Controllers\Traits\Markdown.php;/*** Created by PhpStorm.* User: GucciLee* Date: 2019/3/4* Time: 14:41*/namespace App\Http\Controllers\Traits;use League\HTMLToM...

总结Allegro元件封装(焊盘)制作方法[修整]_weixin_30951743的博客-程序员秘密

总结Allegro元件封装(焊盘)制作方法在Allegro系统中,建立一个零件(Symbol)之前,必须先建立零件的管脚(Pin)。元件封装大体上分两种,表贴和直插。针对不同的封装,需要制作不同的Padstack。Allegro中Padstack主要包括以下部分。1、PAD即元件的物理焊盘pad有三种:RegularPad,规则焊盘(正片中)。可以是:Circle圆型...

经典推送:针对jQuery升级踩坑大全_weixin_33953384的博客-程序员秘密

背景jQuery想必各个web工程师都再熟悉不过了,不过现如今很多网站还采用了很古老的jQuery版本。其实如果早期版本使用不当,可能会有 DOMXSS漏洞,非常建议升级到jQuery 1.9.x或以上版本。前段时间我就主导了这件事情,把公司里我们组负责的项目jQuery版本从1.4.2升级到了jQuery 1.11.3。jQuery官方也...

仿小米商城页面和简单效果_仿小米商城jsp_嘻嘻的博客-程序员秘密

<!DOCTYPE html><html><head> <meta charset="utf-8"> <title>小米商城</title> <link rel="stylesheet" type="text/css" href="css/reset.css"> <link rel="stylesheet" type="text/css" href="css/fonts.css"> <l

随便推点

Bpmn.js 中文文档(一)_MiyueFE的博客-程序员秘密

Bpmn.js 中文文档(一)由于工作需要(其实不是很需要),在公司项目的基础上开源了一个基于 bpmn-js + Vue 2.x + ElementUI 的一个流程编辑器 Bpmn Process Designer, 预览地址 MiyueFE blog, 欢迎 fork 和 star。一. 引入Bpmn.js并初始化建模器/* 基于vue2.x, 省略了template模板与部分data */import BpmnModeler from "bpmn-js/lib/Modeler"exp

如何画双层和四层的PCB_fpc原理图画法_恋风恋歌的干货铺的博客-程序员秘密

电路板概述  电路板的名称有:陶瓷电路板,氧化铝陶瓷电路板,氮化铝陶瓷电路板,线路板,PCB板,铝基板,高频板,厚铜板,阻抗板,PCB,超薄线路板,超薄电路板,印刷(铜刻蚀技术)电路板等。电路板使电路迷你化、直观化,对于固定电路的批量生产和优化用电器布局起重要作用。电路板可称为印刷线路板或印刷电路板,英文名称为(Printed Circuit Board)PCB、(Flexible Print...

移动网络安装测试软件,家宽众测中国移动手机版(在线宽带网速测试器)V2.0.3 去广告版..._吻死破孩的博客-程序员秘密

家宽众测中国移动手机版(在线宽带网速测试器)是一款手机宽带网速测试工具,用户可以通过本软件加入中国移动的宽带评测活动各种,反映家中宽带的具体使用情况,支持在线报名参加,抢先体验则有奖励赠送哦,欢迎来下载。软件介绍一款参与移动宽带评测的客户端应用,想要吐槽您家里的宽带网速,您可以参与家庭宽带品质众测活动,在和粉众测宽带版对家里的网络进行详细的测试,并且说不定还会获取额外的奖励,网络好不好你说了算,快...

Tensorflow2 math常用操作_tensorflow2.math_Lee'La的博客-程序员秘密

Tensorflow2 math常用操作张量的二元操作可以进行广播,与numpy的广播规则一样一、tf.math1.abs返回张量的绝对值,输出类型、形状与输入一致tf.math.abs( x, name=None)a = tf.constant([[1, 2, -1], [4, -3, 2]], dtype=tf.float32)tf.abs(a)>&g...

iOS集成Dcloud_weixin_30764883的博客-程序员秘密

先把补充放在最前面2016年10月25号更新。正如老大所说,愿望是美好的,现阶段h5融合技术难点,我们还没法解决,h5界面相比原生交互性能问题,管理类app操作设置太多。总结下Dcloud,可能不应该是下面这种方法,不能本地一个h5应用,而是应该直接把他当前webview使用就好了。下面可以参考,也可以不参考,可能有错的地方,阶段性弃用了,应该有段时间不去更新修改下面的啦。20...

ssl 1764 1682 USACO 3.1 Agri-Net 最短网络 (最小生成树)#prim#_lemondinosaur的博客-程序员秘密

题意:求最小生成树的权值和。#include <cstdio>#include <cctype>#include <climits>using namespace std;int a[101][101],lowcost[101]; bool v[101];inline int in(){ char x=getchar(); int

推荐文章

热门文章

相关标签