1. 程式人生 > >騰訊雲CentOS7使用yum安裝mysql的問題

騰訊雲CentOS7使用yum安裝mysql的問題

一、問題簡單描述

騰訊雲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包所在的資料夾,執行下面的命令:
    [

    [email protected] centos local]# sudo rpm -Uvh mysql57-community-release-el7-9.noarch.rpm
    (2)之後,進入yum源的配置資料夾:
    [[email protected] centos local]# cd /etc/yum.repos.d/
    [[email protected] centos local]# ls
    會發現,多出了兩個mysql的yun源配置
    這裡寫圖片描述
    備註:yum的配置一般有兩種方式,一種是直接配置/etc目錄下的yum.conf檔案,另外一種是在/etc/yum.repos.d目錄下增加.repo檔案。

  4. 問題來了
    安裝了mysql的yum源後,整個yum源都出了問題。
    (1)例如:執行
    [[email protected] centos local]#yum repolist all | grep mysql
    會出現下面圖中的問題
    這裡寫圖片描述
    (2)執行下面命令,安裝的是其他軟體包,仍然出現同樣的問題。推測一下,應該是該mysql的yum源有問題,導致了整個yum源出錯了。
    [[email protected] centos local]#yum install libaio
    同樣也會出現下面圖中的問題
    這裡寫圖片描述

  5. 總結:騰訊雲CentOS7用yum源安裝mysql的方法行不通

三、解決方法

分兩個步驟:一是刪除已配置mysql的yum源;二是用tar方法安裝mysql(詳細看我的另一篇文章)
1. 刪除剛剛配置的mysql的yum源
[[email protected] centos yum.repos.d]# yum remove mysql57-community-release-el7-9.noarch

  1. 進入yum源的配置資料夾,檢視一下
    [[email protected] centos local]# cd /etc/yum.repos.d/
    [[email protected] centos local]# ls
    可以發現,mysql的yum源別刪除了:
    這裡寫圖片描述

  2. 此時再次安裝其他軟體包,可以看到恢復正常了。
    這裡寫圖片描述

附錄: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:

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

相關推薦

centos7安裝MySQL

安裝 pan AR bsp 平臺 為什麽 community OS rest centos就centos唄,為什麽要加個騰訊雲呢?有這種疑問的兄dei,一定是沒被不同雲的系統坑過啊,阿裏雲的Ubuntu和騰訊雲的Ubuntu不一樣,centos好像也有差別,各個雲平臺,同樣

安裝MySQL

首先安裝MySQL: sudo apt-get install mysql-server sudo apt-get install mysql-client sudo apt-get install libmysqlclient-dev 安裝時記得設定密碼!!! 安

CentOS7安裝mysql各種報錯解決辦法!!以及Navicat連線(服務啟動不了解決辦法)

先釋放一下!氣死我了!! 背景: 在雲主機上安裝mysql來來回回重灌了十幾遍,氣得我昨晚還把雲主機的系統重灌了一遍!!!但是並沒有解決根本問題。最終還是今天上午解決了! 我安裝的mysql是5.6 首先說一下我的錯誤步驟!記住一下是錯誤步驟!

ubuntu安裝使用MySQL

  安裝步驟 [email protected]0-2-ubuntu:~$ sudo apt-get install mysql-server (密碼: root/root) [email protected]-0-2-ubuntu:~$ sudo apt-get

Ubuntu 安裝並遠端訪問 MySQL

道理都懂,但還是連不上的話你就應該來看看... Info:Ubuntu Server 14.04.01 LTS 64 位 DataGrip 2016.2 前言 為了完成作業,不讓伺服器閒置,決定把資料庫放在遠端。免去本地配置的麻煩,這次的配置是基於騰訊的學生雲,系統選擇的是 Ubuntu Server 14.

Ubuntu安裝JDK、tomcat、mysql、部署網站步驟詳解

騰訊雲Ubuntu配置部署步驟:安裝JDK、Tomcat,mysql。部署一個Web的專案演示 1.購買伺服器:這個不用我說了,學生黨可以直接用自己的優惠一元購機 2.Xshell和Xftp或者winscp 因為是遠端操作伺服器,用一個命令操作頁面最好,所以我們選擇Xshell,而Xftp則是用來向伺

ubuntuservermysql安裝和外網訪問

時間 with fonts .net start -1 read 每次 mona 1 騰訊雲 購買ubuntu 默認賬戶是ubuntu(因為winscp 使用ubuntu沒有權限寫文件) 因為騰訊雲主機ubuntu系統默認username為ubuntu,不喜歡每次

centos安裝python3.6和pip

ubunt tmp pen -- 教程 ots pip pan 更改 不知道騰訊雲的centos和阿裏雲的centos一不一樣,反正兩個雲平臺的Ubuntu系統是不一樣的,照著同樣的教程敲,往往掉坑裏。 安裝一些centos依賴庫: 這一步很關鍵,很多報錯往往都因為少了

(Linux)安裝Redis。

-c net detail sans style any col linux ont 參考:https://blog.csdn.net/a575553272/article/details/79743802 指令:ps -ef | grep redis 查看啟動後的進程

(Linux)安裝.net core sdk2.1、net core runtime2.1

cor -m rod asp pac 安裝 core 分享圖片 spn 按照微軟指令安裝: sdk2.1:https://www.microsoft.com/net/download/linux-package-manager/centos/sdk-current 1.

Windows2012 (伺服器)安裝指南

  完成註冊 新建雲主機   域名先域名查詢   新建安全組     1代表成功了   重置密碼 因為第一次都不知道密碼  

Centos7安裝lnmp(php7+mysql5.7+nginx1.14)全過程

安裝nginx 1、首先下載對應當前系統版本(Centos7)的nginx包(package) wget http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch

Ubuntu安裝視覺化桌面

1.安裝圖形介面 sudo apt-get update 更新 1)、sudo apt-get install xinit 2)、sudo apt-get install gdm  ( 登陸視窗,用於管理賬戶登陸的,還可以用來切換別的桌面環境。 ) 3)、sudo apt-get insta

如何在安裝Cloud Foundry

Cloud Foundry是VMware推出的業界第一個開源PaaS雲平臺,它支援多種框架、語言、執行時環境、雲平臺及應用服務,使開發人員能夠在幾秒鐘內進行應用程式的部署和擴充套件,無需擔心任何基礎架構的問題。 雲伺服器(Cloud Virtual Machin

centos7 搭建mysql

參考地址: https://blog.csdn.net/paulowina/article/details/79890644?utm_source=copy  1.檢查環境 安裝前檢查是否安裝過mysql yum list installed mysql* 如果

伺服器安裝jdk

1,先從網路下載安裝包: wget  --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" https://download.o

[小程式開發] 主機配置mysql ,第一步

通過小程式的後臺,推薦的優惠主機活動,花了3塊 大洋,開始了小程式之旅。。。。。 歡呼一下。 優惠主機裡面已經配置好了php 和 小程式的demo ,基本上能用,但是本人想要php 連線上mysql 進行資料互動,那就開始折騰吧。。 centos7的伺服器,百度了一下,需要

SQLyog遠端連線伺服器資料庫Mysql遇到的坑

首先說明我的資料庫是安裝在雲伺服器上,不是專業的資料庫伺服器,沒錯就是10塊錢包月的。   然後覺得使用SQLyog遠端維護資料庫比較方面,可是怎麼都登入不上去。 下面分析原因: 1.安全組是否放過了訪問的埠,這個問題不存在的,我設定的是 ALL 允許所有訪問。 2.防火牆的問題,百度

Centos 安裝nginx

新增CentOS 7 EPEL 倉庫sudo yum instal lepel-release安裝Nginxsudo yum install nginx啟動Nginxsudo systemctl start nginx啟動防火牆sudo systemctl start fir

CentOS7安裝Docker與使用

1.開啟xShell,連線上你的騰訊雲伺服器 2.安裝docker,命令為 yum install docker -y 等待兩分鐘後,會提示安裝成功    3.執行第一個容器,輸入命令為 docker r