1、rpm包mysql
一、wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm(下載rpm)sql
二、rpm -ivh mysql-community-release-el7-5.noarch.rpm(安裝rpm包)數據庫
三、yum install mysql-server (安裝)centos
2、操做MySQLcentos7
一、service mysql start(啓動數據庫)spa
二、service mysql status(查看數據庫狀態)server
三、mysql -u root -p(登陸數據庫)get
三、GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'password' WITH GRANT OPTION;it
flush privileges; (賦值權限)class
四、exit
3、Linux防火牆
一、systemctl status firewalld.service(查看防火牆狀態)
二、systemctl stop firewalld.service (關閉防火牆)
注意點:
centos7中防火牆的文件名有改變:
一、firewalld的基本使用
啓動: systemctl start firewalld
關閉: systemctl stop firewalld
查看狀態: systemctl status firewalld
開機禁用 : systemctl disable firewalld
開機啓用 : systemctl enable firewalld