记录: 分享云计算学习日常

一、忘记数据库root密码

1.vim /etc/my.cnf

2.skip-grant-tables(需要打开密码强度策略,具体步骤看上一篇文章)

3.重启数据库

systemctl restart mysqld

4.desc mysql.user; |  select * from user\   

5.update user set authentication_string=password("新密码") where User='root' and host ='localhost';

6.刷新授权

flush privileges;

7.第一时间关闭跳过授权:

skip-grant-tables

8.关闭策略强度

拓展:

SQL语句修改密码: set password for 用户名@localhost ='新密码'

LNMP      

L:linux     N: nginx   M:mysql   P:php

二、wordpress项目部署

1.部署nginx

yum -y install nginx

2.启动nginx

nginx

3.检查是否启动成功

ss -nplt | grep 80 或者  ps aux | grep nginx

4.部署php

1):yum -y install https://rpms.remirepo.net/enterprise/remi-release-7.rpm

2).yum -y install php74-php-xsl php74-php php74-php-cli php74-php-devel php74-php-gd php74-php-pdo php74-php-mysql php74-php-fpm

5.启动php

systemctl start php74-php-fpm

6.检查是否启动成功

ss -nplt | grep 9000

ps aux |  grep php

7.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;

}

8.检查nginx配置文件的语法

nginx -t

9.重新加载配置文件

nginx -s reload

10. 探测文件

vim /usr/share/nginx/html/index.php

<?pho

    phpinfo();

?>

三、项目上线

1.上传项目

rz   弹出的文件选择框中选择项目包

2.tar -xf wordpress-6.2.2-zh_CN.tar.gz

3.cp -r wordpress/* /usr/share/nginx/html/

  • 14
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值