一、强制修改MySQL登录密码
1、数据库密码修改
#vim /etc/my.cnf 进入数据库配置数据
skip-grant-tables //添加语句,跳过授权表
//validate-password=OFF 这两条命令无法同时存在
2、重启数据库
#systemctl restart mysqld
3、现在可以无密码登录mysql
4、查看表
#desc mysql.user;
#select * from user\G; 可视化
5、改root的密码
#update mysql.user set authentication_string=password('密码') where User='root' and Host='localhost';
6、刷新MySQL的系统权限相关表,否则会出现拒绝访问,还有一种方法,就是重新启动mysql服务器,来使新设置生效。
#flush privileges;
7、修改完,删除配置项
#vim /etc/my.cnf 进入数据库删除下列数据
skip-grant-tables
二、库内温柔修改 MySQL root 密码
#alter user 'root'@'localhost'identified by '密码';
三、LNMP
1、部署nginx
#yum -y install nginx
启动nginx
#nginx
检查是否启动成功
#ss -nplt | grep 80
#ps aux | grep nginx
2、部署php
1)yum -y install https://rpms.remirepo.net/enterprise/remi-release-7.rpm
2)yum -y install php74-php-fpm php74-php-xsl php74-php php74-php-cli php74-php-devel php74-php-gd php74-php-pdo php74-php-mysql php74-php-fpm
启动php
#systemctl start php74-php-fpm
检查是否启动成功
#ss -nplt | grep 9000
#ps aux | grep php
3、nginx关联php
#cp /etc/nginx/nginx.conf /etc/nginx/nginx.conf.old
vim +42 /etc/nginx/nginx.conf
index index.php index.html index.htm;
location ~ \.php$
{
include fastcgi_params;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /usr/share/nginx/html/$fastcgi_script_name;
}
检查nginx配置文件的语法
#nginx -t
重新加载配置文件
#nginx -s reload
探测文件
#vim /usr/share/nginx/html/index.php
<?php
phpinfo();
?>
四、项目上线
1、上传项目
#rz
2、解包
#tar -xzf wordpress-5.9.1-zh_CN.tar.gz
3、复制或者移动目录
#cp -r wordpress/* /usr/share/nginx/html/