赞
踩
rpm -qa | grep mysql
wget -i -c http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm
yum -y install mysql57-community-release-el7-10.noarch.rpm
yum -y install mysql-community-server
如果出现fail报错,执行下面命令
yum -y install mysql-community-server --nogpgcheck
systemctl start mysqld.service
service mysqld status
或ps -ef|grep mysql
mysql -u root -p
grep 'password' /var/log/mysqld.log
alter user 用户名@主机名 identified with by '新密码';
service mysqld stop
->停止服务
service mysqld start
->重启服务
create user 'root'@'%' identified with mysql_native_password by '密码';
grant all on *.* to 'root'@'%';
输入端口号和密码 ->连接
ifconfig -a
查看防火墙状态 systemctl status firewalld 开启防火墙 systemctl start firewalld 关闭防火墙 systemctl stop firewalld 开启防火墙 service firewalld start
若无法开启则输入systemctl unmask firewalld.service,然后再输入systemctl start firewalld.service
firewall-cmd --query-port=3306/tcp
firewall-cmd --add-port=3306/tcp --permanent
firewall-cmd --query-port=3306/tcp 注意:如果查询是no,则需要执行防火墙命令重载 firewall-cmd --reload
重载防火墙 firewall-cmd --reload
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。