Wishlist 0 ¥0.00

mysql内存超出 mysqld: Out of memory 解决办法

 

自己配置的XWAMP环境,默认下没有详细配置mysql的my.ini,一方面不同服务器的配置不一样,另一方面按照默认为空的方式也一直没有出现过问题。不过最近服务器挂掉了,出现的症状是:

    网站不能打开,动态的。静态的可以。
    不能远程桌面。

强制重启服务器后查看系统日志发现了这个错误:

    mysqld: Out of memory (Needed 129040 bytes)

于是找到了mariadb根目录中有几个推荐配置文件:

    my-small.ini:内存小于64M。

    my-medium.ini:内存在32M - 64M之间。

    my-large.ini:内存为512M。

    my-huge.ini:内存在1G-2G之间

    my-innodb-heavy-4G.ini:内存4GB,仅使用innodb存储引擎。

挂掉的服务器是2核(CPU)2GB(内存),选择了my-large.ini的推荐配置,增加了如下配置(放在[mysqld]下):

    skip-external-locking
    key_buffer_size = 256M
    max_allowed_packet = 1M
    table_open_cache = 256
    sort_buffer_size = 1M
    read_buffer_size = 1M
    read_rnd_buffer_size = 4M
    myisam_sort_buffer_size = 64M
    thread_cache_size = 8
    query_cache_size= 16M
    thread_concurrency = 4

应该没有问题了吧。前端提示用户升级IE浏览器代码:快乐浏览(http://browsehappy.osfipin.com/)。win2008错误事件截图(好吧 我是用的windows做服务器的,囧):


以上为解决mysqld: Out of memory问题的思路。

 

About Us

Since 1996, our company has been focusing on domain name registration, web hosting, server hosting, website construction, e-commerce and other Internet services, and constantly practicing the concept of "providing enterprise-level solutions and providing personalized service support". As a Dell Authorized Solution Provider, we also provide hardware product solutions associated with the company's services.
 

Contact Us

Address: No. 2, Jingwu Road, Zhengzhou City, Henan Province

Phone: 0086-371-63520088 

QQ:76257322

Website: 800188.com

E-mail: This email address is being protected from spambots. You need JavaScript enabled to view it.