본문 바로가기
Mysql

table engine type = memory 일때 heap_table_size 용량늘리기

by ohrohi 2019. 10. 24.

고작 1.1M 짜리 db 덤프파일 밀어넣는데 이러한 에러가 발생되었다.

 

ERROR 1114 (HY000) at line 54: The table '테이블명' is full

 

1. sql파일 vi로 열어서 create table 부분 확인 해서 engine type 확인.  ( 명령어로 한번더 확인해봄)

 

mysql> show table status from event like 'sale09_event';

+--------------+--------+---------+------------+------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+-------------+------------+-----------------+----------+----------------+------------------------------------------------------------+
| Name         | Engine | Version | Row_format | Rows | Avg_row_length | Data_length | Max_data_length | Index_length | Data_free | Auto_increment | Create_time         | Update_time | Check_time | Collation       | Checksum | Create_options | Comment                                                    |
+--------------+--------+---------+------------+------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+-------------+------------+-----------------+----------+----------------+------------------------------------------------------------+
| 테이블명  | MEMORY |      10 | Fixed      | 4770 |           3412 |    16303536 |        16299124 |       494784 |         0 |           5103 | 2019-10-24 14:10:41 | NULL        | NULL       | utf8_general_ci |     NULL |                | 코멘트         |
+--------------+--------+---------+------------+------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+-------------+------------+-----------------+----------+----------------+-----

 

구글링과 전문가의 도움 결과  엔진타입=memory는 max_heap_table_size의 영향을 받는다고 했다.

 

- 현재서버상태 확인 (초기 1.6M)

mysql> show variables like '%hea%';
+-----------------------------+----------+
| Variable_name               | Value    |
+-----------------------------+----------+
| innodb_log_write_ahead_size | 8192     |
| innodb_random_read_ahead    | OFF      |
| innodb_read_ahead_threshold | 56       |
| max_heap_table_size         | 16777216 |
+-----------------------------+----------+
4 rows in set (0.00 sec)

 

- 설정 변경 (20G로 늘리기)

1. my.cnf에 추가하기 

max_heap_table_size = 20480M

max_max_heap_table_size = 20480M  -> 이 부분 추가했을때 db재구동 안되서 주석처리후 재시작함.

 

 

2. 명령어로 추가하기

mysql> SET GLOBAL tmp_table_size = 1024 * 1024 * 1024 * 2;
mysql> SET GLOBAL tmp_table_size = 1024 * 1024 * 1024 * 20;

수식 안먹히면 
mysql> SET GLOBAL tmp_table_size = 21474836480;
mysql> SET GLOBAL max_heap_table_size = 21474836480;

 

- DB 재구동 후 확인

 

mysql> show variables like '%hea%';
+-----------------------------+-------------+
| Variable_name               | Value       |
+-----------------------------+-------------+
| innodb_log_write_ahead_size | 8192        |
| innodb_random_read_ahead    | OFF         |
| innodb_read_ahead_threshold | 56          |
max_heap_table_size         | 21474836480 |
+-----------------------------+-------------+

'Mysql' 카테고리의 다른 글

my.cnf 수정 후 에러시  (0) 2019.10.22
mysql general_log 설정하기  (0) 2019.10.22
Mysql 시간동기화 설정  (0) 2019.10.17
mysql 계정 권한설정 (all 제외)  (0) 2019.08.23
db 유저추가 및 권한설정  (0) 2019.08.21