gpt4 book ai didi

mysql - 错误 [InnoDB] mmap(137428992 字节)失败;错误号 12

转载 作者:行者123 更新时间:2023-11-29 07:25:19 34 4
gpt4 key购买 nike

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

这是mysql配置my.cnf。我在那里包含了 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] 部分的建议

# 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 行,以便默认值允许您运行。

如果您有 0.5 G 的 RAM,预计会遇到挫折。在这个时间点,很少有人使用少于 4 G 的 RAM。

关于mysql - 错误 [InnoDB] mmap(137428992 字节)失败;错误号 12,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54167454/

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