美文网首页
CentOS部署MYSQL

CentOS部署MYSQL

作者: 清霆 | 来源:发表于2019-08-05 15:01 被阅读0次

    1. 卸载mariadb(如有)

    rpm -qa | grep mariadb

    rpm -e --nodeps mariadb*包名

    2. 安装MYSQL

    yum install -y https://repo.mysql.com/mysql80-community-release-el7.rpm

    yum install mysql-community-server

    systemctl start  mysqld.service

    3. 配置MYSQL

    grep"password" /var/log/mysqld.log  //查看初始密码

    mysql -uroot -p密码

    set globalvalidate_password.policy=0;

    set globalvalidate_password.length=8;

    ALTER USER'root'@'localhost' IDENTIFIED BY 'Mysql密码';

    exit

    mysqld --verbose--help | grep -A 1 "Default options"

    vim /etc/my.cnf

    default_password_lifetime=0

    systemctl enable mysqld.service

    systemctl restart mysqld.service

    firewall-cmd--zone=public --add-port=3306/tcp --permanent

    firewall-cmd--reload

    相关文章

      网友评论

          本文标题:CentOS部署MYSQL

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