原创

Centos7安装Nginx和MySQL8

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

↓↓↓ 打开微信关注我的微信公众号 ↓↓↓

会打篮球的程序猿

领取精品免费学习资料哦~
正文到此结束
本文目录