Centos7 下安装mysql

#prepare for install
 
#We can check that the repository is effectively active by running:
yum repolist enabled | grep "mysql.*-community.*"
 
# install mysql , 5.6.33
yum install mysql-community-server
 
# start mysql service 
systemctl start mysqld
 
#check mysql service's status
systemctl status mysqld
 
#connect from local 
mysql -u root
 
#modify password
set password=password("123");
 
#open 3306 port 
 
iptables-save > mysql_3306.conf
 
vim mysql_3306.conf
# add content into text;
-A INPUT -p tcp -m state --state NEW -m tcp --dport 3306 -j ACCEPT
 
iptables-restore < mysql_3306.conf
原文地址:https://www.cnblogs.com/mousean/p/5959349.html