安装前查看是否已安装

rpm -qa | grep -i mysql yum remove mysql(相关软件包名称) -y

wget https://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm

yum localinstall mysql57-community-release-el7-11.noarch.rpm

yum install mysql-community-server

systemctl start mysqld

查看默认密码

grep 'temporary password'/var/log/mysqld.log

登陆mysql

mysql -uroot -pxxxxxx

降低mysql密码强度验证

set global validate_password_policy=0;

修改密码

ALTER USER 'root'@'localhost' IDENTIFIED BY 'whmysql19851210';

创建用户

GRANT ALL PRIVILEGES ON . TO jpress@"%" IDENTIFIED BY "jpress19851210" WITH GRANT OPTION; flush privileges;

外网访问不到mysql的解决办法:

通过systemctl status firewalld查看firewalld状态 通过systemctl start firewalld开启防火墙 sudo firewall-cmd --zone=public --permanent --add-port=3306/tcp sudo firewall-cmd --reload

最后修改于 2018-11-08 10:48:07
如果觉得我的文章对你有用,请随意赞赏
扫一扫支付
上一篇