gpt4 book ai didi

MySQL 已经不再支持大型查询

转载 作者:行者123 更新时间:2023-11-29 12:02:39 24 4
gpt4 key购买 nike

我在 RackSpace 上的 CentOS 6.6 和 MySQL 版本 5.5.40 上安装并运行了 MySQL。在运行大量查询时,我总是遇到此错误。

这是my.cnf的设置

[mysqld]
2 datadir=/mnt/data/mysql
3 tmpdir=/mnt/data/temp
4 socket=/var/lib/mysql/mysql.sock
5 bind-address=0.0.0.0
6 port=3306
7 wait_timeout=432000
8 max_allowed_packet=1G
9 max_connections=500
10 query-cache-size=0
11 query-cache-type=0
12 #query_cache_size=64M
13 #query_cache_limit=64M
14 key_buffer_size=1G
15 sort_buffer_size=16M
16 tmp_table_size=32M
17 max_heap_table_size=32M
18 read_buffer_size=512K
19 read_rnd_buffer_size=512K
20 thread_cache_size=50
21
22 innodb_buffer_pool_size=12G
23 innodb_buffer_pool_instance=2
24 innodb_read_io_threads=12
25 innodb_write_io_threads=12
26 innodb_io_capacity=300
27 innodb_log_file_size=128M
28 innodb_thread_concurrency=0

这是我在崩溃后捕获的错误日志:

150820 13:46:26 mysqld_safe Number of processes running now: 0

150820 13:46:26 mysqld_safe mysqld restarted

150820 13:46:26 [Note] Plugin 'FEDERATED' is disabled.

150820 13:46:26 [Warning] Using unique option prefix innodb_buffer_pool_instance instead of innodb-buffer-pool-instances is deprecated and will be removed in a future release. Please use the full name instead.

150820 13:46:26 InnoDB: The InnoDB memory heap is disabled

150820 13:46:26 InnoDB: Mutexes and rw_locks use GCC atomic builtins

150820 13:46:26 InnoDB: Compressed tables use zlib 1.2.3

150820 13:46:26 InnoDB: Using Linux native AIO

150820 13:46:26 InnoDB: Initializing buffer pool, size = 12.0G

InnoDB: mmap(6593445888 bytes) failed; errno 12

150820 13:46:27 InnoDB: Completed initialization of buffer pool

150820 13:46:27 InnoDB: Fatal error: cannot allocate memory for the buffer pool

150820 13:46:27 [ERROR] Plugin 'InnoDB' init function returned error.

150820 13:46:27 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.

150820 13:46:27 [ERROR] Unknown/unsupported storage engine: InnoDB

150820 13:46:27 [ERROR] Aborting



150820 13:46:27 [Note] /usr/libexec/mysqld: Shutdown complete



150820 13:46:27 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended

编辑:

RackSpace VM 的规范为:

CPU:Intel(R) Xeon(R) CPU E5-2670 0 @ 2.60GHz内存:8GB

最佳答案

您的服务器只有 8 GB RAM,并且您为 mysql 分配了过多的 RAM。

即使您需要更改许多变量的配置,但首先要解决您的问题,请进行以下更改 -

innodb_buffer_pool_instance=2 #暂时注释掉,稍后再设置。

innodb_buffer_pool_size=6G

key_buffer_size=20M #如果你的服务器是innodb,但如果你也使用myisam表,那么保持原样。

sort_buffer_size=2M # 我们可以稍后更改。

read_buffer_size=512K # 暂时注释掉。

read_rnd_buffer_size=512K #暂时将其注释为每个 session 使用的内容

tmp_table_size=1G #这可能是您的问题的原因,因此请增加它。

max_heap_table_size=1G #这可能是您的问题的原因,因此请增加它。

如果可能,请将 max_connections 从 500 减少到 400,因为每个连接都会占用服务器资源。

尝试并分享结果。

关于MySQL 已经不再支持大型查询,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32110750/

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