mysql经常报Out of memory (Needed 3143840 bytes) 求解决~~

服务器配置:
内存64G
下面是mysql的my.cnf配置:
[mysqld]
port =3306
socket = /opt/dc_mysql/data/mysql.sock
skip-external-locking
key_buffer =384M
max_allowed_packet = 16M
table_cache =1024
sort_buffer_size = 4M
read_buffer_size = 4M
read_rnd_buffer_size = 8M
myisam_sort_buffer_size = 64M
thread_cache = 64
query_cache_size= 32M
max_connections = 180
max_connect_errors = 128
max_error_count = 128
max_heap_table_size=512M
tmp_table_size=512M
join_buffer_size = 8M
#open_files_limit = 4048
# Try number of CPU's*2 for thread_concurrency
thread_concurrency =32
请求高手调优mysql。非常感谢。

1、试下:sort_buffer_size = 2M
read_buffer_size = 2M

2、找到出问题的SQL,减少select出来的字段的数量,优化语句。追问

试了sort_buffer_size = 2M read_buffer_size = 2M。还是有报错。问题sql是更新字段。sql比较长。

追答

这个SQL的业务场景过于复杂,可以拆分成两个SQL,分别赋值;或者把统计的工作提前进行。
你把explain这个语句的截图贴上来,可以再分析下。

温馨提示:答案为网友推荐,仅供参考
第1个回答  2013-10-22
增大 query_cache_limit,max_heap_table_size,tmp_table_size