How to install MySQL from a network yum source

Source: Internet
Author: User

Recently, to build a local MySQL environment, the preparation and installation process are as follows:


1. Software Environment:

CentOS 7

Mysql 5.6


2. Linux Environment installation Method comparison:

Installation method Advantages Disadvantages
Source Package Compilation Installation
  • The function module of the software can be customized;
  • Source code compilation optional parameters, error-prone;

  • The compilation and installation process takes a long time;

  • Does not have the software management function;

RPM Installation (Redhat package Manager)
  • Provide software management function, install, upgrade, uninstall;

  • Easy and fast operation;

  • inter-package dependencies;
Yum installation (Yellow dog updater,modified)
  • Support Online, offline two ways;

  • Automatic resolution of dependency relationships;



3. Yum Introduction

Before you start the installation, learn about the common commands and related configurations for Yum below.

3.1 Yum Common commands

    • Query Software Installation Status

Yum List installed #查询已安装的软650) this.width=650; "Src=" https://s1.51cto.com/wyfs02/M02/A6/66/ Wkiol1nn8thiaikoaaekzpawxga916.png "title=" Yum list installed.png "alt=" Wkiol1nn8thiaikoaaekzpawxga916.png "/>

Yum List Installed|grep package #查询具体某软件是否安装650) this.width=650; "Src=" https://s3.51cto.com/wyfs02/M00/07/B4/ Wkiom1nn9hpstfjlaaayqiq9j6o619.png "title=" Yum List installed Grep.png "alt=" wkiom1nn9hpstfjlaaayqiq9j6o619.png "/ >

    • Installing the Software

      Yum Install PackageName #在线安装软件包

650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M01/A6/66/wKioL1nN90Ox5nkcAACWcEHAjzk376.png "title=" yum Install Rabbimq.png "alt=" Wkiol1nn90ox5nkcaacwcehajzk376.png "/>


Yum Localinstall packagename.rpm #本地安装

650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M00/07/B5/wKiom1nN96WxzrmrAAAddbbrrlw224.png "title=" yum Localinstall.png "alt=" Wkiom1nn96wxzrmraaaddbbrrlw224.png "/>


    • Update Software

      Yum List Updates #列出可更新升级的软件

650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M00/07/B9/wKiom1nOL8vDr9q7AAEPqLrfr2c980.png "title=" yum List Update (2). png "alt=" Wkiom1nol8vdr9q7aaepqlrfr2c980.png "/>

Yum Update Package_name #更新软件

650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M02/A6/6A/wKioL1nOL22z-ZarAADcCzLCB6c721.png "title=" yum Update Python.png "alt=" Wkiol1nol22z-zaraadcczlcb6c721.png "/>


    • Uninstalling software

      Yum Remove Package_name #只删除软件包, preserving configuration files and data files;

Yum Erase Package_name #删除软件和它所有的文件.


3.2 Creating a network Yum source

To build a Yum source, you need to know the following configuration files and related directories first.

/etc/yum.conf #yum的配置文件, configuring cache path, log path, and GPG check

/etc/yum.repos.d/#自定义的仓库

/var/log/yum.log #yum日志

/var/cache/yum/#存储下载的rpm包


yum.conf configuration file, mainly divided into two parts, [main] partial configuration of global variables, the second part of the configuration of the warehouse server, which can also be stored in the/etc/yum.repos.d/directory, saved as. repo file configuration.

The following information is/etc/yum.conf content:

[Email protected] etc]# NL yum.conf

1 [main]

2 cachedir=/var/cache/yum/$basearch/$releasever

3 keepcache=0

4 debuglevel=2

5 Logfile=/var/log/yum.log

6 Exactarch=1

7 Obsoletes=1

8 Gpgcheck=1

9 Plugins=1

Teninstallonly_limit=5

bugtracker_url=http://bugs.centos.org/set_project.php?project_id=23&ref=http://bugs.centos.org/ Bug_report_page.php?category=yum

Distroverpkg=centos-release

# This is the default, if do this bigger Yum won ' t see if the metadata

Newer on the remote and so you'll "gain" the bandwidth of not have to

# Download the new metadata and ' pay ' for it by Yum don't have correct

# information.

+ It is esp. important, to has correct metadata, for distributions like

# Fedora which don ' t keep old packages around. If you don ' t like this checking

# interupting your command line usage, it's much better to has something

# Manually check the metadata once an hour (Yum-updatesd'll do).

# metadata_expire=90m

# PUT YOUR REPOS here OR in separate files named File.repo

# IN/ETC/YUM.REPOS.D


After you have learned the above knowledge, start creating the MySQL repository file.

cd/etc/yum.repos.d/

Touch Mysql-community.repo

VI Mysql-community.repo


Add the following information to the file:

#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=1 #0为关闭yum源, 1 to open the Yum source

Gpgcheck=0 #0为不需要验证软件包, 1 is required to verify the package

gpgkey=


4. Install MySQL

With the repository, and know the Yum command, you can install it!

Simply execute the yum install MySQL and make a quick and easy command!

650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M00/07/BB/wKiom1nOVGjQNXw2AAEUaGn6LFQ894.png "title=" yum Install MySQL (2). png "alt=" Wkiom1novgjqnxw2aaeuagn6lfq894.png "/>

650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M02/A6/6D/wKioL1nOVLaRSG5XAACuj-j98II402.png "title=" Installed.png "alt=" Wkiol1novlarsg5xaacuj-j98ii402.png "/> Then you can use MySQL!


After the installation, look at the files under the cache directory/var/cache/yum, you can view the RPM package for get.

650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M01/A6/6C/wKioL1nOTcrzuOtrAAA76MwbS7U666.png "title=" cache File.png "alt=" Wkiol1notcrzuotraaa76mwbs7u666.png "/>


Resources:

Linux system command and Shell Scripting Practice Guide

"Linux command line and Shell scripting Encyclopedia"



This article is from the "Le Gakuen" blog, please be sure to keep this source http://2338053.blog.51cto.com/2328053/1969853

How to install MySQL from a network yum source

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.