Wordpress登录数据库连接失败的问题

发布于:2025-07-16 ⋅ 阅读:(20) ⋅ 点赞:(0)

报错:

● mysqld.service - MySQL Server
Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Tue 2025-07-15 11:18:35 CST; 1min 30s ago
Docs: man:mysqld(8)
http://dev.mysql.com/doc/refman/en/using-systemd.html
Process: 26003 ExecStartPre=/usr/bin/mysqld_pre_systemd (code=exited, status=127)
Main PID: 4124 (code=exited, status=1/FAILURE)

Jul 15 11:18:35 VM-4-15-centos systemd[1]: Starting MySQL Server...
Jul 15 11:18:35 VM-4-15-centos systemd[1]: mysqld.service: control process exited, code=exited status=127
Jul 15 11:18:35 VM-4-15-centos systemd[1]: Failed to start MySQL Server.
Jul 15 11:18:35 VM-4-15-centos systemd[1]: Unit mysqld.service entered failed state.
Jul 15 11:18:35 VM-4-15-centos systemd[1]: mysqld.service failed.

最开始系统报错:

2025-06-13T09:50:55.998093Z 3340 [Warning] [MY-013360] [Server] Plugin sha256_password reported: ''sha256_password' is deprecated and will be removed in a future release. Please use caching_sha2_password instead'
2025-06-13T11:27:55.122940Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.36) starting as process 4124
2025-06-13T11:27:55.188306Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2025-06-13T11:27:55.232892Z 0 [Warning] [MY-012681] [InnoDB] page_aligned_alloc mmap(137236480 bytes) failed; errno 12
2025-06-13T11:27:55.233033Z 1 [ERROR] [MY-012956] [InnoDB] Cannot allocate memory for the buffer pool
2025-06-13T11:27:55.233069Z 1 [ERROR] [MY-012930] [InnoDB] Plugin initialization aborted with error Generic error.
2025-06-13T11:27:55.233110Z 1 [ERROR] [MY-010334] [Server] Failed to initialize DD Storage Engine
2025-06-13T11:27:55.233255Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
2025-06-13T11:27:55.233274Z 0 [ERROR] [MY-010119] [Server] Aborting
2025-06-13T11:27:55.234540Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.36) MySQL Community Server - GPL

以为是内存池不够导致的,但是云服务后台查看还有50%以上的内存空间没有使用,但是依旧按照文章的办法将my.conf的参数修改为64M并增加了SWAP的内存大小。


 innodb_buffer_pool_size = 32M

但是错误依旧存在,内容为:

Jul 15 10:15:08 VM-4-15-centos systemd[1]: Unit mysqld.service entered failed state.
Jul 15 10:15:08 VM-4-15-centos systemd[1]: mysqld.service failed.
Jul 15 10:15:08 VM-4-15-centos polkitd[691]: Unregistered Authentication Agent for unix-process:12036:302109437 (system bus name :1.80437, object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale en_US.utf8) (disconnected from bus)
Jul 15 10:15:08 VM-4-15-centos sudo[12034]: pam_unix(sudo:session): session closed for user root
Jul 15 10:15:08 VM-4-15-centos systemd-logind[705]: Removed session 40031.

此时,突然想起来之前VSC无法登录ssh期间我升级了glib到2.28版本,并且yum出现了一些问题,于是

sudo yum update -y

报错:

sudo yum update -y
error: rpmdb: BDB0113 Thread/process 2314/139854510331136 failed: BDB1507 Thread died in Berkeley DB library
error: db5 error(-30973) from dbenv->failchk: BDB0087 DB_RUNRECOVERY: Fatal error, run database recovery
error: cannot open Packages index using db5 - (-30973)
error: cannot open Packages database in /var/lib/rpm
CRITICAL:yum.main:

Error: rpmdb open failed

重新数据库之后:

sudo rm -rf /var/lib/rpm/__db*
sudo rpm --initdb
sudo rpm --rebuilddb

全部更新后,正常启动mysql服务。
这个原因应该是我的rpm数据库损坏导致无法启动进程导致的网站无法访问,与内存无关也与权限无关。


网站公告

今日签到

点亮在社区的每一天
去签到