国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 數據庫 > MySQL > 正文

MYSQL錯誤:Out of memory (Needed 1046596 bytes)

2024-07-24 12:37:10
字體:
來源:轉載
供稿:網友

Out of memory根據我們對英文了理解是超出的內存空間,也就是說你mysql占用了大量的內存了,或是沒有配置好,下面小編來給各位同學介紹一下.

MYSQL內存設置問題,可調整tmp_table_size大小解決,增大query_cache_limit 的值,還有max_heap_table_size和tmp_table_size的值.

因為我們的存儲過程中用了好多的預處理語句,而且語句的結果都是非常大的,起初我的結果,代碼如下:

  1. mysql> show variables like 'max_heap_table_size';  
  2. +---------------------------------+----------------------+  
  3. | Variable_name | Value |  
  4. +---------------------------------+----------------------+  
  5. | max_heap_table_size | 16777216 |  
  6. +---------------------------------+----------------------+ 
  7. mysql> show variables like 'tmp_table_size';  
  8. +---------------------------------+----------------------+  
  9. | Variable_name | Value |  
  10. +---------------------------------+----------------------+  
  11. | tmp_table_size | 16777216 |  
  12. +---------------------------------+----------------------+ 

我改了my.cnf文件,代碼如下:

  1. mysql> show variables like 'max_heap_table_size';  
  2. +---------------------------------+----------------------+  
  3. | Variable_name | Value |  
  4. +---------------------------------+----------------------+  
  5. | max_heap_table_size | 67108864 |  
  6. +---------------------------------+----------------------+ 
  7. mysql> show variables like 'tmp_table_size';  
  8. +---------------------------------+----------------------+  
  9. | Variable_name | Value |  
  10. +---------------------------------+----------------------+  
  11. | tmp_table_size | 67108864 |  
  12. +---------------------------------+----------------------+ 

我的配置方法如下:

  1. [client] 
  2. #password       = your_password 
  3. port            = 3306 
  4. socket          = /var/lib/mysql/mysql.sock 
  5. # The MySQL server 
  6. [mysqld] 
  7. port            = 3306 
  8. socket          = /var/lib/mysql/mysql.sock 
  9. skip-locking 
  10. # Cache & Buffer Size 
  11. max_allowed_packet = 1G 
  12. key_buffer_size =768M 
  13. table_cache =256M 
  14. sort_buffer_size =64M 
  15. read_buffer_size =64M 
  16. read_rnd_buffer_size =64M 
  17. myisam_sort_buffer_size = 64M 
  18. tmp_table_size=256M  ====================對這里進行修改即可 
  19. query_cache_type=1 
  20. query_cache_limit=32M 
  21. connect_timeout=100000 
  22. binary logging is required for replication 
  23. log-bin=mysql-bin 
  24. binary logging format - mixed recommended 
  25. binlog_format=mixed 
  26. # required unique id between 1 and 2^32 - 1 
  27. # defaults to 1 if master-host is not set 
  28. # but will not function as a master if omitted 
  29. server-id       = 1 
  30. # Uncomment the following if you are using InnoDB tables 
  31. innodb_data_home_dir = /var/lib/mysql/ 
  32. innodb_data_file_path = ibdata1:10M:autoextend 
  33. innodb_log_group_home_dir = /var/lib/mysql/ 
  34. innodb_buffer_pool_size = 768M 
  35. innodb_additional_mem_pool_size = 512M 
  36. innodb_log_file_size = 5M 
  37. innodb_log_buffer_size = 8M 
  38. [mysqldump] 
  39. quick 
  40. max_allowed_packet = 16M 
  41. [mysql] 
  42. no-auto-rehash 
  43. # Remove the next comment character if you are not familiar with SQL 
  44. #safe-updates   //Vevb.com 
  45. [myisamchk] 
  46. key_buffer_size = 32M 
  47. sort_buffer_size = 32M 
  48. read_buffer = 8M 
  49. write_buffer = 8M 
  50. [mysqlhotcopy] 
  51. interactive-timeout

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 周口市| 多伦县| 阳新县| 东宁县| 甘泉县| 凌云县| 大石桥市| 米脂县| 中方县| 南华县| 绥棱县| 永靖县| 临海市| 新昌县| 玉田县| 蒲城县| 渑池县| 灌云县| 吉首市| 河曲县| 库尔勒市| 安龙县| 通化市| 辰溪县| 昌黎县| 白山市| 磐安县| 溧水县| 新泰市| 百色市| 肥东县| 杭锦后旗| 宣武区| 黄山市| 吴忠市| 开封县| 昭觉县| 马关县| 阿拉尔市| 栾川县| 东方市|