zoukankan      html  css  js  c++  java
  • CentOS7下安装MySQL5.7安装与配置(YUM)

    介绍在CentOS7上yum安装数据库服务器MySQL Community Server 5.7的方法。

    准备

    CentOS7默认安装了和MySQL有兼容性的MariaDB数据库,在我们安装MySQL5.7之前为了避免发生冲突首先删除MariaDB。

    # rpm -qa | grep maria
    mariadb-libs-5.5.50-1.el7_2.x86_64
    
    # yum remove mariadb-libs -y
    

    添加MySQL的yum源

    在CentOS7上yum安装MySQL需使用MySQL的yum源。执行以下命令首先添加MySQL的yum源。

    # yum localinstall http://dev.mysql.com/get/mysql57-community-release-el7-7.noarch.rpm
    

    添加MySQL的yum源之后可以使用yum info命令搜索mysql-community-server,确认详细的信息。

    # yum info mysql-community-server
    Available Packages
    Name        : mysql-community-server
    Arch        : x86_64
    Version     : 5.7.14
    Release     : 1.el7
    Size        : 152 M
    Repo        : mysql57-community/x86_64
    Summary     : A very fast and reliable SQL database server
    URL         : http://www.mysql.com/
    License     : Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. Under GPLv2 license as shown in the Description field.
    Description : ........
    

    安装MySQL5.7

    以上yum info命令是2016年8月28日的执行结果,当前安装的MySQL版本是5.7.14。确认安装版本之后执行以下命令进行安装。

    # yum install mysql-community-server -y
    

    到此MySQL5.7安装就完成了,接下来确认安装的MySQL版本。

    # mysqld --version
    mysqld  Ver 5.7.14 for Linux on x86_64 (MySQL Community Server (GPL))
    

    启动及停止MySQL

    完成安装步骤之后,首先配置MySQL的开机自动启动,在这里使用systemctl命令

    # systemctl enable mysqld.service
    

    接着使用systemctl start mysqld.service命令启动MySQL。

    # systemctl start mysqld.service
    

    而停止MySQL时使用systemctl stop mysqld.service命令。

    # systemctl stop mysqld.service
    

    以上是在CentOS7.2安装MySQL Community Server 5.7的步骤,但仅限于安装后续还需要根据开发的系统进行配置。

    MySQL5.7开始MySQL管理用户root的密码,会默认生成并记录到/var/log/mysqld.log文件里,不要忘记修改默认密码。

    [Note] A temporary password is generated for root@localhost: lQidlh;BX4*x  
  • 相关阅读:
    matplotlib.pyplot---------Python强大的绘图功能软件
    Python常用的几种数据结构-链表,数组,字典
    Python实现矩阵
    Linux常用命令----存
    观《解忧杂货店》有感
    js格式化日期
    读取web应用中properties配置文件(这种方法可能不是最好的)
    easyui 获得ComboBox选中项的值 getValue
    request 报错The remote server returned an error: (415) Unsupported Media Type.
    No mapping found for HTTP request with URI [/spring/WEB-INF/page/index.jsp] in DispatcherServlet with name 'spring'
  • 原文地址:https://www.cnblogs.com/wangxishan/p/6414316.html
Copyright © 2011-2022 走看看