本文介绍了错误[InnoDB] mmap(137428992字节)失败;埃尔诺12的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Web应用程序未连接到VDS(0.5 RAM,1核心CPU)上的数据库.我不明白原因.我不知道该怎么办,请告诉我.

The web application does not connect to the database on VDS (0.5 RAM, 1 core CPU). I can't understand the reason. I do not know what to do please tell me.

这是mysql配置my.cnf.我在这里包括了innodb_buffer_pool_size = 250M

This is mysql configuration my.cnf. I included there innodb_buffer_pool_size = 250M

# For explanations see
# http://dev.mysql.com/doc/mysql/en/server-system-variables.html

# * IMPORTANT: Additional settings that can override those from this file!
#   The files must end with '.cnf', otherwise they'll be ignored.
#
!includedir /etc/mysql/conf.d/
!includedir /etc/mysql/mysql.conf.d/

[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
symbolic-links=0
max_connections=25
max_user_connections=20
wait_timeout=10
interactive_timeout=50
long_query_time=5
#log-queries-not-using-indexes
#log-slow-queries=/var/log/mysql/log-slow-queries.log

bind-address=185.231.154.57
#key_buffer = 16M
myisam_sort_buffer_size = 32M
join_buffer_size=1M
read_buffer_size=1M
sort_buffer_size=2M
#table_cache=1024
thread_cache_size=286
interactive_timeout=25
connect_timeout=5
max_allowed_packet=1M
max_connect_errors=1000
#query_cache_limit=1M
#query_cache_size=8M
#query_cache_type=1
tmp_table_size=16M

#innodb_use_native_aio = 0
innodb_buffer_pool_size = 250M
innodb_file_per_table

[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid 

日志:

root@v101877:/home/servers/apache-tomee-plume-8.0.0-M1/binsystemctl status mysql
* mysql.service - MySQL Community Server
   Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Sun 2019-01-13 10:04:17 MSK; 10min ago
     Docs: man:mysqld(8)
           http://dev.mysql.com/doc/refman/en/using-systemd.html
  Process: 681 ExecStart=/usr/sbin/mysqld (code=exited, status=1/FAILURE)
  Process: 642 ExecStartPre=/usr/share/mysql-8.0/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
 Main PID: 681 (code=exited, status=1/FAILURE)
   Status: "SERVER_BOOTING"

Jan 13 10:04:17 v101877.hosted-by-vdsina.ru mysqld[681]: 2019-01-13T07:04:17.608676Z 0 [ERROR] [MY-012681] [InnoDB] mmap(137428992 bytes) failed; errno 12
Jan 13 10:04:17 v101877.hosted-by-vdsina.ru mysqld[681]: 2019-01-13T07:04:17.610517Z 1 [ERROR] [MY-012956] [InnoDB] Cannot allocate memory for the buffer pool
Jan 13 10:04:17 v101877.hosted-by-vdsina.ru mysqld[681]: 2019-01-13T07:04:17.610553Z 1 [ERROR] [MY-012930] [InnoDB] Plugin initialization aborted with error Generic error.
Jan 13 10:04:17 v101877.hosted-by-vdsina.ru mysqld[681]: 2019-01-13T07:04:17.611113Z 1 [ERROR] [MY-010334] [Server] Failed to initialize DD Storage Engine
Jan 13 10:04:17 v101877.hosted-by-vdsina.ru mysqld[681]: 2019-01-13T07:04:17.612755Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
Jan 13 10:04:17 v101877.hosted-by-vdsina.ru mysqld[681]: 2019-01-13T07:04:17.613398Z 0 [ERROR] [MY-010119] [Server] Aborting
Jan 13 10:04:17 v101877.hosted-by-vdsina.ru mysqld[681]: 2019-01-13T07:04:17.626404Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.13)  MySQL Community Server - GPL.
Jan 13 10:04:17 v101877.hosted-by-vdsina.ru systemd[1]: mysql.service: Main process exited, code=exited, status=1/FAILURE
Jan 13 10:04:17 v101877.hosted-by-vdsina.ru systemd[1]: mysql.service: Failed with result 'exit-code'.
Jan 13 10:04:17 v101877.hosted-by-vdsina.ru systemd[1]: Failed to start MySQL Community Server.

推荐答案

您的my.cnf [mysqld]部分要考虑的建议

Suggestions to consider for your my.cnf [mysqld] section

# join_buffer_size=1M
# read_buffer_size=1M
# sort_buffer_size=2M
# table_cache=1024
# thread_cache_size=286
innodb_buffer_pool_size=10M

直到您可以开始使用.是的,请禁用所有这5行,以便使用DEFAULTS可以开始运行.

until you can get started. Yes, DISABLE all 5 of these lines so the DEFAULTS will allow you to get running.

如果您有0.5 G的RAM,请期待FRUSTRATION.此时,很少有人使用少于4 G的RAM.

If you have .5 G of RAM, expect FRUSTRATION. Very few people use less than 4 G of RAM at this point in time.

这篇关于错误[InnoDB] mmap(137428992字节)失败;埃尔诺12的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-19 21:42