修改完MySQL的登录密码后 发现网页登录不了mysql,出现建立数据库时连接出错

此方法只适用于本人,其余人慎行!!!

首先重启nginx

[root@localhost ~]# systemctl restart nginx。

进入/usr/local/nginx/html/下

[root@localhost ~]# cd  /usr/local/nginx/html/
[root@localhost html]# ll
总用量 216
-rw-r--r--  1 nginx nginx   405 8月  23 10:37 index.php
-rw-r--r--  1 nginx nginx 19915 8月  23 10:37 license.txt
-rw-r--r--  1 nginx nginx  7437 8月  23 10:37 readme.html
-rw-r--r--  1 nginx nginx  7165 8月  23 10:37 wp-activate.php
drwxr-xr-x  9 nginx nginx  4096 8月  23 10:37 wp-admin
-rw-r--r--  1 nginx nginx   351 8月  23 10:37 wp-blog-header.php
-rw-r--r--  1 nginx nginx  2338 8月  23 10:37 wp-comments-post.php
-rw-rw-rw-  1 nginx nginx  3275 8月  23 10:50 wp-config.php
-rw-r--r--  1 nginx nginx  3001 8月  23 10:37 wp-config-sample.php
drwxr-xr-x  6 nginx nginx    84 8月  23 11:06 wp-content
-rw-r--r--  1 nginx nginx  3939 8月  23 10:37 wp-cron.php
drwxr-xr-x 26 nginx nginx 12288 8月  23 10:37 wp-includes
-rw-r--r--  1 nginx nginx  2496 8月  23 10:37 wp-links-opml.php
-rw-r--r--  1 nginx nginx  3900 8月  23 10:37 wp-load.php
-rw-r--r--  1 nginx nginx 47916 8月  23 10:37 wp-login.php
-rw-r--r--  1 nginx nginx  8582 8月  23 10:37 wp-mail.php
-rw-r--r--  1 nginx nginx 23025 8月  23 10:37 wp-settings.php
-rw-r--r--  1 nginx nginx 31959 8月  23 10:37 wp-signup.php
-rw-r--r--  1 nginx nginx  4747 8月  23 10:37 wp-trackback.php
-rw-r--r--  1 nginx nginx  3236 8月  23 10:37 xmlrpc.php

查看自己的ip  看有没有发生变化。

[root@localhost html]# ip a

没有变化以后,删除/html下的所有文件

[root@localhost html]# rm -rf *
[root@localhost ~]# ll
总用量 70308
-rw-------.  1 root  root      1401 8月  21 21:11 anaconda-ks.cfg
-rw-r--r--.  1 root  root       371 8月  22 09:49 local.repo
drwxr-xr-x. 38  7161 31415     4096 6月  10 2019 mysql-5.7.27
-r--------.  1 root  root  51436383 7月   7 20:31 mysql-boost-5.7.27.tar.gz
drwxr-xr-x.  9 nginx nginx      186 8月  22 10:30 nginx-1.22.1
-r--------.  1 root  root   1073948 7月   7 20:31 nginx-1.22.1.tar.gz
drwxr-xr-x   5  1006  1006     4096 3月   3 2022 wordpress
-r--------   1 root  root  19461582 7月   7 20:31 wordpress-5.9.1-zh_CN.tar.gz

进入wordpress

[root@localhost ~]# cd  wordpress
[root@localhost wordpress]# ll
总用量 212
-rw-r--r--  1 1006 1006   405 2月   6 2020 index.php
-rw-r--r--  1 1006 1006 19915 1月   1 2022 license.txt
-rw-r--r--  1 1006 1006  7437 12月 29 2021 readme.html
-rw-r--r--  1 1006 1006  7165 1月  21 2021 wp-activate.php
drwxr-xr-x  9 1006 1006  4096 3月   3 2022 wp-admin
-rw-r--r--  1 1006 1006   351 2月   6 2020 wp-blog-header.php
-rw-r--r--  1 1006 1006  2338 11月 10 2021 wp-comments-post.php
-rw-r--r--  1 1006 1006  3001 12月 14 2021 wp-config-sample.php
drwxr-xr-x  5 1006 1006    69 3月   3 2022 wp-content
-rw-r--r--  1 1006 1006  3939 8月   3 2021 wp-cron.php
drwxr-xr-x 26 1006 1006 12288 3月   3 2022 wp-includes
-rw-r--r--  1 1006 1006  2496 2月   6 2020 wp-links-opml.php
-rw-r--r--  1 1006 1006  3900 5月  16 2021 wp-load.php
-rw-r--r--  1 1006 1006 47916 1月   4 2022 wp-login.php
-rw-r--r--  1 1006 1006  8582 9月  23 2021 wp-mail.php
-rw-r--r--  1 1006 1006 23025 12月  1 2021 wp-settings.php
-rw-r--r--  1 1006 1006 31959 10月 25 2021 wp-signup.php
-rw-r--r--  1 1006 1006  4747 10月  9 2020 wp-trackback.php
-rw-r--r--  1 1006 1006  3236 6月   9 2020 xmlrpc.php

将wordpress下的所有文件复制到/usr/local/nginx/html

[root@localhost wordpress]# cp -r *  /usr/local/nginx/html/
[root@localhost wordpress]# systemctl restart nginx

最后再次重启nginx就好了

方法二:  特此声明  此方法是我的同桌  超级无敌美丽宇宙大爆炸美少女 张晓教我的!!!

[root@localhost ~]# cd /usr/local/nginx/html/

进入 vim  wp-config.php   将第26行的密码 改成新密码 就可以了.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值