gpt4 book ai didi

mysql - 建立数据库连接时出错 - WordPress 和 mysql

转载 作者:行者123 更新时间:2023-11-29 10:25:41 24 4
gpt4 key购买 nike

我的 WordPress 网站经常出现错误建立数据库连接时出错

之前,我使用 sudo chmod 755/var/lib/mysqlsudo/etc/init.d/mysql restart 来修复它。然而,这一次,他们不能再干活了; sudo/etc/init.d/mysql 返回

stop: Unknown instance: 
start: Job failed to start

并且mysqld --verbose返回

180120  3:24:48 [Warning] Using unique option prefix key_buffer instead of key_buffer_size is deprecated and will be removed in a future release. Please use the full name instead.
180120 3:24:48 [Warning] Can't create test file /var/lib/mysql/chengtie.lower-test
180120 3:24:48 [Note] mysqld (mysqld 5.5.58-0ubuntu0.14.04.1) starting as process 20724 ...
180120 3:24:48 [Warning] Can't create test file /var/lib/mysql/chengtie.lower-test
180120 3:24:48 [Warning] Can't create test file /var/lib/mysql/chengtie.lower-test
180120 3:24:48 [Warning] One can only use the --user switch if running as root

180120 3:24:48 [Warning] Using unique option prefix myisam-recover instead of myisam-recover-options is deprecated and will be removed in a future release. Please use the full name instead.
180120 3:24:48 [Note] Plugin 'FEDERATED' is disabled.
mysqld: Can't find file: './mysql/plugin.frm' (errno: 13)
180120 3:24:48 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
180120 3:24:48 InnoDB: The InnoDB memory heap is disabled
180120 3:24:48 InnoDB: Mutexes and rw_locks use GCC atomic builtins
180120 3:24:48 InnoDB: Compressed tables use zlib 1.2.8
180120 3:24:48 InnoDB: Using Linux native AIO
180120 3:24:48 InnoDB: Initializing buffer pool, size = 128.0M
InnoDB: mmap(137363456 bytes) failed; errno 12
180120 3:24:48 InnoDB: Completed initialization of buffer pool
180120 3:24:48 InnoDB: Fatal error: cannot allocate memory for the buffer pool
180120 3:24:48 [ERROR] Plugin 'InnoDB' init function returned error.
180120 3:24:48 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
180120 3:24:48 [ERROR] Unknown/unsupported storage engine: InnoDB
180120 3:24:48 [ERROR] Aborting

180120 3:24:48 [Note] mysqld: Shutdown complete

有人知道如何恢复我的网站吗?

最佳答案

您的 Droplet 没有足够的内存来启动 MySQL。看到错误 InnoDB: mmap(137363456 bytes) failed; errno 12 - MySQL 在尝试分配 ~130MB 内存时失败。
运行free -m来检查有多少内存可供应用程序使用。

您可以通过两种方式解决此问题:

  1. 增加液滴的尺寸。这会花费你更多的钱。
  2. Add (more) swap space to your droplet. 这很可能会影响性能,但可以节省金钱。

关于mysql - 建立数据库连接时出错 - WordPress 和 mysql,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48354053/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com