• mysql的安装、启动和基础配置 —— linux版本


    环境和资源地址

    *** centos 7 ***

    http://repo.mysql.com/yum/mysql-5.6-community/

    安装

    安装方式一(在线安装):

    复制代码
    # 查看和mysql有关的安装包
    yum search mysql
    # 安装mysql社区版本yum源 yum
    -y install http://repo.mysql.com/yum/mysql-5.6-community/el/7/x86_64/mysql-community-release-el7-5.noarch.rpm
    # 找到community社区版本的mysql包
    yum search mysql |grep community
    
    # 使用yum安装下列 yum
    -y install mysql-community-server.x86_64 mysql-community-client.x86_64 mysql-community-server.x86_64 mysql-community-client.x86_64
    复制代码

    安装方式二(离线安装):

    复制代码
    # 下载离线包
    yumdownloader mysql-community-server.x86_64 mysql-community-client.x86_64 mysql-community-libs.x86_64 mysql-community-common.x86_64
    

    安装

    yum -y install mysql-community-client-5.6.41-2.el7.x86_64.rpm mysql-community-server-5.6.41-2.el7.x86_64.rpm mysql-community-common-5.6.41-2.el7.x86_64.rpm mysql-community-libs-5.6.41-2.el7.x86_64.rpm

    复制代码

    操作mysql相关常用shell命令

    复制代码
    # 启停服务
    systemctl {start|stop|restart|status} mysqld.service
    systemctl start mysqld.service
    

    查看服务状态

    systemctl status mysqld.service

    安全初始化

    /usr/bin/mysql_secure_installation

    停系统防火墙

    systemctl stop firewalld.service

    查看强制访问控制状态

    getenforce

    关闭强制访问控制策略

    setenforce 0

    复制代码

    登陆和初始化密码

    # 创建root远程登陆密码
    mysql -h 127.0.0.1 -u root -p
    

    mysql> grant all privileges on . to root@'%' identified by "root";

    mysql> flush privileges;

  • 相关阅读:
    2021牛客暑期多校训练营5
    二分图知识点温习
    Codeforces Round #735 (Div. 2)
    牛客比赛订正(3,4)
    Harbour.Space Scholarship Contest 2021-2022 (Div. 1 + Div. 2) Editorial题解
    关于球的相关知识
    AtCoder Beginner Contest 210题解
    P7077 [CSP-S2020] 函数调用
    偏序问题学习笔记
    P1606 [USACO07FEB]Lilypad Pond G
  • 原文地址:https://www.cnblogs.com/l-hf/p/11533905.html
Copyright © 2020-2023  润新知