![](/img/trans.png)
[英]mysql err, mysqli_real_connect(): (HY000/2002): No such file or directory
[英]AWS MYSQL (mysqli_real_connect(): (HY000/2002)) : cannot allocate memory for the buffer pool
我在AWS中有一個t2.small實例已經運行了10個月的大部分時間而沒有重新啟動EC2實例/ apache server / mysqld服務器突然,幾分鍾之前,它無法連接到數據庫。
我無法訪問任何連接到數據庫的頁面並嘗試登錄phpmyadmin返回錯誤mysqli_real_connect(): (HY000/2002): No such file or directory
因此,在恐慌時,我做了以下事情:
sudo service mysqld restart
重新啟動mysql服務器,但它只是一直STOPPED
使用STOPPED
由於它已經崩潰,我想知道為什么它崩潰了,以及如何防止它再次崩潰。
我挖到mysqld.log並找到以下信息:
Version: '5.6.39' socket: '/var/lib/mysql/mysql.sock' port: 3306 MySQL Community Server (GPL)
2019-06-17 14:08:19 15623 [Warning] Buffered warning: Performance schema disabled (reason: init fa
iled).
2019-06-17 14:08:19 15623 [Note] Plugin 'FEDERATED' is disabled.
2019-06-17 14:08:19 15623 [Note] InnoDB: Using atomics to ref count buffer pool pages
2019-06-17 14:08:19 15623 [Note] InnoDB: The InnoDB memory heap is disabled
2019-06-17 14:08:19 15623 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2019-06-17 14:08:19 15623 [Note] InnoDB: Memory barrier is not used
2019-06-17 14:08:19 15623 [Note] InnoDB: Compressed tables use zlib 1.2.8
2019-06-17 14:08:19 15623 [Note] InnoDB: Using Linux native AIO
2019-06-17 14:08:19 15623 [Note] InnoDB: Using CPU crc32 instructions
2019-06-17 14:08:19 15623 [Note] InnoDB: Initializing buffer pool, size = 128.0M
InnoDB: mmap(137363456 bytes) failed; errno 12
2019-06-17 14:08:19 15623 [ERROR] InnoDB: Cannot allocate memory for the buffer pool
2019-06-17 14:08:19 15623 [ERROR] Plugin 'InnoDB' init function returned error.
2019-06-17 14:08:19 15623 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2019-06-17 14:08:19 15623 [ERROR] Unknown/unsupported storage engine: InnoDB
2019-06-17 14:08:19 15623 [ERROR] Aborting
...
...(shutdown a bunch of plugins)
...
2019-06-17 14:08:19 15623 [Note] /usr/libexec/mysql56/mysqld: Shutdown complete
我四處搜索,發現Inconsistent InnoDB Buffer Pool Size https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/MySQL.KnownIssuesAndLimitations.html
具體來說,它通過以下操作詳細說明了緩沖池大小不一致的解決方案
innodb_buffer_pool_chunk_size = 536870912
innodb_buffer_pool_instances = 4
innodb_buffer_pool_size = (536870912 * 4) * 8 = 17179869184
問題:
top
不時檢查並總是有它至少有一半免費)。 536870912
? 我在哪里放線? (/etc/my.cnf中)? 感謝您閱讀以及任何意見或建議。
1)我encoutered同樣的問題,得到它由以下解決此 。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.