美文网首页
CentOS7安装mysql

CentOS7安装mysql

作者: RayEden | 来源:发表于2016-10-21 08:30 被阅读0次
    sudo yum remove mariadb* -y
    
    sudo yum install vim -y
    sudo mkdir /home/mysql
    cd /home/mysql
    
    sudo wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm
    sudo rpm -ivh mysql-community-release-el7-5.noarch.rpm
    sudo yum update -y
    sudo yum install mysql-server -y
    sudo systemctl start mysqld
    sudo service mysql start
    mysqladmin -u root password "root123"
    
    
    sudo systemctl stop firewalld.service
    sudo systemctl disable firewalld.service
    sudo yum install iptables-services -y
    sudo systemctl enable iptables
    
    
    sudo iptables -I INPUT -p tcp --dport 3306 -j ACCEPT
    
    grant all privileges on *.* to 'root'@'%' identified by 'root123';
    flush privileges;
    
    sudo netstat -lntp | grep 3306
    

    相关文章

      网友评论

          本文标题:CentOS7安装mysql

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