最新消息:20190717 VPS服务器:Vultr新加坡,WordPress主题:大前端D8,统一介绍入口:关于

【暂时解决】crifan.com网站打不开:建立数据库连接时出错

crifan.com crifan 151浏览 0评论

昨晚去升级了WordPress后,提示升级数据库,也升级了。

当时后台管理页面是可以正常打开的。

第二天发现网站无法打开了:

https://www.crifan.com

建立数据库连接时出错

去看看什么情况。

期间去:

【已解决】Mac中安装和使用SecureCRT

参考之前的:

【已解决】crifan.com网站无法打开:建立数据库连接时出错

重启mysql试试:

systemctl stop mysqld
systemctl start mysqld
systemctl status mysqld

结果:

[root@crifan ~]# systemctl stop mysqld
[root@crifan ~]# systemctl start mysqld
[root@crifan ~]# systemctl status mysqld
● mysqld.service - LSB: start and stop MySQL
   Loaded: loaded (/etc/rc.d/init.d/mysqld; bad; vendor preset: disabled)
   Active: active (running) since Mon 2019-11-25 12:00:53 CST; 4s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 13730 ExecStop=/etc/rc.d/init.d/mysqld stop (code=exited, status=0/SUCCESS)
  Process: 13776 ExecStart=/etc/rc.d/init.d/mysqld start (code=exited, status=0/SUCCESS)
   CGroup: /system.slice/mysqld.service
           ├─13789 /bin/sh /usr/local/mysql/bin/mysqld_safe --datadir=/data/m...
           └─14631 /usr/local/mysql/bin/mysqld --basedir=/usr/local/mysql --d...

Nov 25 12:00:51 crifan.com systemd[1]: Starting LSB: start and stop MySQL…

Nov 25 12:00:53 crifan.com mysqld[13776]: Starting MySQL..[  OK  ]

Nov 25 12:00:53 crifan.com systemd[1]: Started LSB: start and stop MySQL.

结果问题依旧:

重启网站的VPS所在的vultr的服务器试试:

Log In – Vultr.com

wordpress 建立数据库连接时出错

解决WordPress建立数据库连接时出错 | WordPress大学

去phpmyadmin中看看

不过先去试试:

wp-config.php

define( 'WP_ALLOW_REPAIR', true );

重启php

centos 重启php

重启php-fpm – 歪麦博客

[root@crifan www.crifan.com]# service php-fpm restart
Redirecting to /bin/systemctl restart php-fpm.service
[root@crifan www.crifan.com]# service php-fpm status
Redirecting to /bin/systemctl status php-fpm.service
● php-fpm.service - The PHP FastCGI Process Manager
   Loaded: loaded (/usr/lib/systemd/system/php-fpm.service; enabled; vendor preset: disabled)
   Active: active (running) since Mon 2019-11-25 13:45:09 CST; 9s ago
     Docs: http://php.net/docs.php
Main PID: 4706 (php-fpm)
   CGroup: /system.slice/php-fpm.service
           ├─4706 php-fpm: master process (/usr/local/php/etc/php-fpm.conf)
...
           └─4745 php-fpm: pool www

Nov 25 13:45:09 crifan.com systemd[1]: Stopped The PHP FastCGI Process Manager.

Nov 25 13:45:09 crifan.com systemd[1]: Started The PHP FastCGI Process Manager.

结果:

问题依旧。

访问:

https://www.crifan.com/wp-admin/

结果:

一些数据表不可用。也许需要修复数据库。

https://www.crifan.com/wp-admin/maint/repair.php?referrer=is_blog_installed

WordPress › 数据库修复

有些数据表无效。若您希望让WordPress尝试修复它们,请点击“修复数据库”按钮。修复过程需要一点时间,请耐心等待。
修复数据库
WordPress还可以尝试优化数据库,这在某些情况下能提高数据库性能。修复和优化数据库的过程需要一段时间,请耐心等待——在此期间我们会锁定(lock)数据表。
修复并优化数据库

修复数据库

修复并优化数据库

WordPress › 数据库修复

wp_users数据表正常。
    wp_users数据表已优化过了。

“wp_usermeta”数据表有问题。报告的问题是:8 clients are using or haven't closed the table properly。WordPress正在尝试进行修复…
    无法修复wp_usermeta表。错误消息:8 clients are using or haven't closed the table properly

“wp_posts”数据表有问题。报告的问题是:10 clients are using or haven't closed the table properly。WordPress正在尝试进行修复…
    无法修复wp_posts表。错误消息:10 clients are using or haven't closed the table properly

“wp_comments”数据表有问题。报告的问题是:26 clients are using or haven't closed the table properly。WordPress正在尝试进行修复…
    无法修复wp_comments表。错误消息:26 clients are using or haven't closed the table properly

“wp_links”数据表有问题。报告的问题是:1 client is using or hasn't closed the table properly。WordPress正在尝试进行修复…
    无法修复wp_links表。错误消息:1 client is using or hasn't closed the table properly

“wp_options”数据表有问题。报告的问题是:Table is marked as crashed。WordPress正在尝试进行修复…
    无法修复wp_options表。错误消息:Table is marked as crashed

“wp_postmeta”数据表有问题。报告的问题是:35 clients are using or haven't closed the table properly。WordPress正在尝试进行修复…
    无法修复wp_postmeta表。错误消息:35 clients are using or haven't closed the table properly

“wp_terms”数据表有问题。报告的问题是:6 clients are using or haven't closed the table properly。WordPress正在尝试进行修复…
    无法修复wp_terms表。错误消息:6 clients are using or haven't closed the table properly

“wp_term_taxonomy”数据表有问题。报告的问题是:7 clients are using or haven't closed the table properly。WordPress正在尝试进行修复…
    无法修复wp_term_taxonomy表。错误消息:7 clients are using or haven't closed the table properly

“wp_term_relationships”数据表有问题。报告的问题是:7 clients are using or haven't closed the table properly。WordPress正在尝试进行修复…
    无法修复wp_term_relationships表。错误消息:7 clients are using or haven't closed the table properly

wp_termmeta数据表正常。

“wp_commentmeta”数据表有问题。报告的问题是:26 clients are using or haven't closed the table properly。WordPress正在尝试进行修复…
    无法修复wp_commentmeta表。错误消息:26 clients are using or haven't closed the table properly

部分数据库问题无法修复。请复制下列错误信息,前往WordPress支持论坛寻求帮助。

和:

wp_usermeta: 8 clients are using or haven't closed the table properly
wp_posts: 10 clients are using or haven't closed the table properly
wp_comments: 26 clients are using or haven't closed the table properly
wp_links: 1 client is using or hasn't closed the table properly
wp_options: Table is marked as crashed
wp_postmeta: 35 clients are using or haven't closed the table properly
wp_terms: 6 clients are using or haven't closed the table properly
wp_term_taxonomy: 7 clients are using or haven't closed the table properly
wp_term_relationships: 7 clients are using or haven't closed the table properly
wp_commentmeta: 26 clients are using or haven't closed the table properly

再去登录

https://www.crifan.com/wp-admin/

正常可以去登录了。

结果始终无法登录了:

点击 Lost your password

请输入您的用户名或电子邮箱地址。您会收到一封包含创建新密码链接的电子邮件。

用户名或电子邮件地址

https://www.crifan.com/wp-login.php?action=lostpassword

前端页面暂时可以显示了。

https://www.crifan.com/

目前暂时不去登录后台

抽空再去解决后台登录问题

后来发现是记错密码了。。

输入正确密码,即可登录

WordPress后台

去取消之前的数据库的尝试修复:

再重启php

# service php-fpm restart

后续就正常了。

另外抽空去搜搜看:

WordPress 部分数据库问题无法修复

wordpress数据库出现问题,没办法修复怎么办?求高手解答?尽可能详细点。_百度知道

WordPress提示修复数据库:define( ‘WP_ ALLOW_ REPAIR’, true); – 里维斯社

【已解决】wordpress网站crifan.com访问出错:建立数据库连接时出错 – 在路上

目前暂时没遇到问题,就不深入研究了。

如果后续有问题,再去研究之前的:

wp_usermeta: 8 clients are using or haven’t closed the table properly

之类的问题。

转载请注明:在路上 » 【暂时解决】crifan.com网站打不开:建立数据库连接时出错

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
61 queries in 0.115 seconds, using 18.46MB memory