[英]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.