1. Adding the MySQL Yum Repository

    First, add the MySQL Yum repository to your system's
    repository list. Follow these steps:

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

    2. Select and download the release package for your
      platform.

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

      Press CTRL+C to copy
      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:

      Press CTRL+C to copy
      shell> sudo rpm -Uvh mysql80-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
    (https://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 8.0)

          is enabled by default, and the subrepositories for all other
    series (for example, the MySQL 5.7 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
    <span class="command"><strong>yum</strong></span> in the command with
    <span class="command"><strong>dnf</strong></span>):
    Press CTRL+C to copy
    shell> yum repolist all | grep mysql

    To install the latest release from the latest GA series, no
    configuration is needed. To install the latest release from a
    specific series other than the latest GA series, disable the
    subrepository for the latest GA series and enable the
    subrepository for the specific series before running the
    installation command. If your platform supports the
    yum-config-manager or dnf
    config-manager
    command, you can do that by issuing,
    for example, the following commands, which disable the
    subrepository for the 8.0 series and enable the
    one for the 5.7 series; for platforms that are
    not dnf-enabled:

    Press CTRL+C to copy
    shell> sudo yum-config-manager --disable mysql80-community
    shell> sudo yum-config-manager --enable mysql57-community

    For dnf-enabled platforms:

    Press CTRL+C to copy
    shell> sudo dnf config-manager --disable mysql80-community
    shell> sudo dnf config-manager --enable mysql57-community

    Besides using yum-config-manager or the
    dnf config-manager command, you can also
    select a series by editing manually the
    /etc/yum.repos.d/mysql-community.repo
    file. This is a typical entry for a release series'
    subrepository in the file:

    Press CTRL+C to copy
    [mysql80-community]
    name=MySQL 8.0 Community Server
    baseurl=http://repo.mysql.com/yum/mysql-8.0-community/el/6/$basearch/
    enabled=1
    gpgcheck=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
          Find the entry for the subrepository you want to configure,
    and edit the <code class="option">enabled</code> option. Specify
    <code class="option">enabled=0</code> to disable a subrepository, or
    <code class="option">enabled=1</code> to enable a subrepository. For
    example, to install MySQL 5.7, make sure you
    have <code class="option">enabled=0</code> for the above subrepository
    entry for MySQL 8.0, and have
    <code class="option">enabled=1</code> for the entry for the
    5.7 series:
    </p><div class="copytoclipboard-wrapper" style="position: relative;"><pre class="programlisting line-numbers language-ini"><div class="docs-select-all right" id="sa47436371" style="display: none;"><div class="copy-help left" style="display: none;">Press CTRL+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class=" language-ini"><span class="token comment" spellcheck="true"># Enable to use MySQL 5.7</span>

    [mysql57-community]

    name=MySQL 5.7 Community Server

    baseurl=http://repo.mysql.com/yum/mysql-5.7-community/el/6/$basearch/

    enabled=1

    gpgcheck=1

    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 (for dnf-enabled systems, replace

yum in the command with

dnf):

Press CTRL+C to copy
shell> yum repolist enabled | grep mysql
  • Installing MySQL

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

    Press CTRL+C to copy
    shell> sudo yum install mysql-community-server

    This installs the package for the MySQL server, as well as
    other required packages.

  • Starting the MySQL Server

    Start the MySQL server with the following command:

    Press CTRL+C to copy
    shell> sudo service mysqld start

    For EL7-based platforms, this is the preferred command:

    Press CTRL+C to copy
    shell> sudo systemctl start mysqld.service

    You can check the status of the MySQL server with the
    following command:

    Press CTRL+C to copy
    shell> sudo service mysqld status

    For EL7-based platforms, this is the preferred command:

    Press CTRL+C to copy
    shell> sudo systemctl status mysqld.service

    MySQL Server Initialization (as of MySQL
    5.7):
    At the initial start up of the server, the
    following happens, given that the data directory of the server
    is empty:

    • The server is initialized.

    • An SSL certificate and key files are generated in the data
      directory.

    • The validate_password
      plugin
      is installed and enabled.

    • A superuser account 'root'@'localhost'
      is created. A password for the superuser is set and stored
      in the error log file. To reveal it, use the following
      command:

      Press CTRL+C to copy
      shell> sudo grep 'temporary password' /var/log/mysqld.log

      Change the root password as soon as possible by logging in
      with the generated, temporary password and set a custom
      password for the superuser account:

      Press CTRL+C to copy
      shell> mysql -uroot -p
      Press CTRL+C to copy
      mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass4!';
    Note

    MySQL's
    validate_password
    plugin is installed by default. This will require that
    passwords contain at least one upper case letter, one lower
    case letter, one digit, and one special character, and that
    the total password length is at least 8 characters.

  • 在 centos6 安装 MySQL5.7 官方文档的更多相关文章

    1. linux安装oracle的官方文档

      1:https://docs.oracle.com/cd/E11882_01/install.112/e47689/toc.htm 2:https://oracle-base.com/articles ...

    2. MySQL8.0.28安装教程全程参考MySQL官方文档

      前言 为了MySQL8.0.28安装教程我竟然在MySQL官方文档逛了一天,至此献给想入门MySQL8.0的初学者.以目前最新版本的MySQL8.0.28为示例进行安装与初步使用的详细讲解,面向初学者 ...

    3. CentOS7.3利用kubeadm安装kubernetes1.7.3完整版(官方文档填坑篇)

      安装前记: 近来容器对企业来说已经不是什么陌生的概念,Kubernetes作为Google开源的容器运行平台,受到了大家的热捧.搭建一套完整的kubernetes平台,也成为试用这套平台必须迈过的坎儿 ...

    4. 在 Ubuntu 上安装 TensorFlow (官方文档的翻译)

      本指南介绍了如何在 Ubuntu 上安装 TensorFlow.这些指令也可能对其他 Linux 变体起作用, 但是我们只在Ubuntu 14.04 或更高版本上测试了(我们只支持)  这些指令. 一 ...

    5. kafka安装配置及操作(官方文档)http://kafka.apache.org/documentation/(有单节点多代理配置)

      https://www.cnblogs.com/biehongli/p/7767710.html w3school https://www.w3cschool.cn/apache_kafka/apac ...

    6. selenium安装及官方文档

      selenium-python官方文档: https://selenium-python.readthedocs.io/ python3.5已安装的情况下,安装示意图如下 命令行输入 pip3 ins ...

    7. ubuntu16.04下snort的安装(官方文档安装)(图文详解)

      不多说,直接上干货! 最近为了科研,需要安装和使用Snort. snort的官网 https://www.snort.org/ Snort作为一款优秀的开源主机入侵检测系统,在windows和Linu ...

    8. ubuntu14.04下snort的安装(官方文档安装)(图文详解)

      不多说,直接上干货! 最近为了科研,需要安装和使用Snort. snort的官网 https://www.snort.org/ Snort作为一款优秀的开源主机入侵检测系统,在windows和Linu ...

    9. 【Phabricator】教科书一般的Phabricator安装教程(配合官方文档并带有踩坑解决方案)

      随着一声惊雷和滂沱的大雨,我的Phabricator页面终于在我的学生机上跑了起来. 想起在这五个小时内踩过的坑甚如大学隔壁炮王干过的妹子,心里的成就感不禁油然而生. 接下来,我将和大家分享一下本人在 ...

    随机推荐

    1. 企业bi解决方案,商业智能BI作用

      ​随着越来越多的公司将商业智能BI引入到日常运营和商业决策中,BI的热点逐渐起来了.商业智能系统兴起,那BI对企业有什么好处呢? 简单的说,就是可以帮助企业管理者直观清晰的看到自己想要关注的数据,帮助 ...

    2. 运行jar包使用外部依赖

      nohup java -Dloader.path="lib/" -Dfile.encoding=utf-8 -jar test.jar > test.out 2>&am ...

    3. 【C# IO 操作】C#修改文件或文件夹的权限,为指定用户、用户组添加完全控制权限

      代码实现 在C盘添加一个文件夹,并在文件夹内部,新建一个文本文件,如图所示: 该文件夹下,新建一个文本文件,如图所示: 为文件添加完全控制权限: /// <summary> /// 为文件 ...

    4. bool 类型位逻辑运算符(| & ^)与条件逻辑运算符(|| &&)的区别

      bool 类型的运算符 & ^|   &&  ||   ! 运算符&&和|| 是短路的,这意味着如果左侧表达式的值足以确定结果,则它们将不会评估其右侧表达式. ...

    5. ASP.NET Core 6框架揭秘实例演示[15]:针对控制台的日志输出

      针对控制台的ILogger实现类型为ConsoleLogger,对应的ILoggerProvider实现类型为ConsoleLoggerProvider,这两个类型都定义在 NuGet包"M ...

    6. 进程&线程(二):Thread相关方法与属性

      学习自:python进程.线程.协程 - 张岩林 - 博客园 1.threading.Thread Thread方法 方法(使用方法为Thread.xxx) 说明 start() 激活线程 getNa ...

    7. JAVA——运算符

      目录 运算符 1.算术运算符 练习题: 2.关系运算符(比较运算符) 3.逻辑运算符 3.1&& 和 & 使用区别 3.2|| 和 | 使用区别 3.3 取反 基本规则 3.4 ...

    8. windows下安装gym

      安装gym在执行pip install -e'.[all]'这句语句时,可能会出现这种情况 在pycharm中运行的时候会出现如下这种情况: 或者这种情况 出现这种问题可能是python的版本太高了, ...

    9. unittest的discover方法批量执行02

      前言 我们在写用例的时候,单个脚本的用例好执行,那么多个脚本的时候,如何批量执行呢?这时候就需要用到unittet里面的discover方法来加载用例了. 加载用例后,用unittest里面的Text ...

    10. supervisor启动报错

      supervisor 启动失败报错 Error: Another program is already listening on a port that one of our HTTP servers ...