PHP when querying MySQL, reported out of memory error (select COUNT (DISTINCT))

Source: Internet
Author: User

Hours server queries the number of coaches, use the Select COUNT (Distinct (U_strno)) times to exceed memory errors. After reference "Mysqld-nt:out of memory Solution" http://jingyan.baidu.com/article/020278116b428d1bcd9ce568.html?qq-pf-to=pcqq.c2c

Modify Parameters:

Key_buffer = 512K #global buffer = Key_buffer = 200M #global buffer

Key_buffer_size = 3096M =>key_buffer_size = 512M

Core tip: Check mysqld configuration my.conf, focus on Key_buffer_size, Max_heap_table_size, tmp_table_size several parameters,

The recommended setting key_buffer_size value is 1/4 of max_heap_table_size.

After modifying the two parameters, restart Apache to resolve the problem.

PHP when querying MySQL, reported out of memory error (select COUNT (DISTINCT))

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.