美文网首页
CentOS 7 MySQL 5.7 yum安装

CentOS 7 MySQL 5.7 yum安装

作者: 炸鱼最好吃 | 来源:发表于2020-12-28 21:43 被阅读0次

    准备依赖环境

    yum install -y wget yum-utils
    

    添加yum存储库

    wget https://repo.mysql.com/mysql80-community-release-el7-3.noarch.rpm
    rpm -ivh mysql80-community-release-el7-3.noarch.rpm
    

    设置yum存储库为5.7版本

    yum-config-manager --enable mysql57-community
    yum-config-manager --disable mysql80-community
    

    执行安装

    yum install -y mysql-community-server mysql-community-client
    

    初始化mysql

    mysqld --initialize-insecure --user=mysql
    

    启动mysql服务

    systemctl start mysqld
    

    检查mysql服务状态

    running说明启动成功。

    systemctl status mysqld
    

    登录

    mysql -uroot -p
    

    设置密码

    ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass4!';
    

    相关文章

      网友评论

          本文标题:CentOS 7 MySQL 5.7 yum安装

          本文链接:https://www.haomeiwen.com/subject/bktxoktx.html