美文网首页
centos7 mysql 5.7 安装

centos7 mysql 5.7 安装

作者: shangyaqi | 来源:发表于2018-06-07 09:20 被阅读43次

    下载源
    wget http://repo.mysql.com/mysql57-community-release-el7-10.noarch.rpm
    安装源
    rpm -Uvh mysql57-community-release-el7-10.noarch.rpm
    安装MySQL服务端
    yum install -y mysql-community-server
    启动mysql
    systemctl start mysqld.service
    检查状态
    systemctl status mysqld.service

    获取临时密码
    grep 'temporary password' /var/log/mysqld.log
    登陆
    mysql -uroot -p
    修改mysql密码
    ALTER USER 'root'@'localhost' IDENTIFIED BY 'root123';

    授权远程登陆
    grant all privileges on . to root@'%'identified by 'password';
    FLUSH PRIVILEGES;

    修改数据库配置文件:
    vim /etc/my.cnf

    [mysqld]
    character-set-server=utf8
    collation-server=utf8_general_ci
    lower_case_table_names=1
    max_allowed_packet=32M
    max_connections=3000

    重启
    systemctl restart mysqld

    相关文章

      网友评论

          本文标题:centos7 mysql 5.7 安装

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