原创

Centos7安装Nginx和MySQL8

温馨提示:
本文最后更新于 2019年01月09日,已超过 2,157 天没有更新。若文章内的图片失效(无法正常加载),请留言反馈或直接联系我

Centos7安装Nginx

yum install -y epel-release

yum install -y nginx

systemctl enable nginx

systemctl start nginx

systemctl status nginx
[root@lzhpo-light nginx]# pwd
/etc/nginx
[root@lzhpo-light nginx]# vi nginx.conf

Centos7安装MySQL8

# 下载MySQL yum源(https://dev.mysql.com/downloads/repo/yum/)
wget https://dev.mysql.com/get/mysql80-community-release-el7-1.noarch.rpm

# 安装yum源
yum localinstall -y mysql80-community-release-el7-1.noarch.rpm

# 更新yum源
yum clean all
yum makecache

# 开始安装MySQL
yum install -y mysql-community-server

# 设置开机自启MySQL
systemctl start mysqld

# 查看初始化密码
cat /var/log/mysqld.log | grep password
mysql -u root -p

mysql > use mysql;

# 报错ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
# 解决办法(设置低级密码)
SET GLOBAL validate_password.policy=0;

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

mysql > FLUSH PRIVILEGES;
mysql> update user set host='%' where user='root';

mysql> ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY '123456'; 

mysql > FLUSH PRIVILEGES;

参考文章: https://segmentfault.com/a/1190000015634108

本文目录