[英]Error establishing a database connection - WordPress and mysql
我的WordPress網站經常出現Error establishing a database connection
。
以前,我使用sudo chmod 755 /var/lib/mysql
和sudo /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
InnoDB: mmap(137363456 bytes) failed; errno 12
嘗試分配〜130MB內存時MySQL失敗。
運行free -m
以檢查應用程序有多少可用內存。
您可以通過兩種方式解決此問題:
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.