티스토리 뷰

먼저 수정 해야 할 파일의 위치를 알아야한다.

 

sort_buffer_size를 조정 해야하는데, my.cnf파일에 추가 해야한다.

 

위치를 알아보자.

 

➜  / mysql --help | grep my.cnf
                      order of preference, my.cnf, $MYSQL_TCP_PORT,
/etc/my.cnf /etc/mysql/my.cnf /opt/homebrew/etc/my.cnf ~/.my.cnf

이렇게 표시된다. 

 

그리고 보통은

/usr/local/etc/my.cnf
/usr/local/Cellar/mariadb/10.5.9/.bottle/etc/my.cnf

 

맥 인텔 계열일 경우 위와 같은 경로로 찾을 수 있고,

 

m1인 경우는 

/opt/homebrew/etc/my.cnf
/opt/homebrew/Cellar/mysql/8.0.27_1/.bottle/etc/my.cnf

으로 찾을 수 있다.

 

그리고 my.cnf에 아래와 같이 바꿔주고,

➜  /etc cd /opt/homebrew/etc 
➜  etc git:(stable) cat my.cnf
# Default Homebrew MySQL server config
[mysqld]
# Only allow connections from localhost
bind-address = 127.0.0.1
mysqlx-bind-address = 127.0.0.1

sort_buffer_size=8M

 

다시 서비스를 시작해준당.

➜  ~ brew services restart mysql
Stopping `mysql`... (might take a while)
==> Successfully stopped `mysql` (label: homebrew.mxcl.mysql)
==> Successfully started `mysql` (label: homebrew.mxcl.mysql)

 

바꼈는지 확인은 mysql 들어가서 다음과 같이 하면 확인 할 수 있다.

mysql> show variables like'%sort_buffer_size%';
+-------------------------+---------+
| Variable_name           | Value   |
+-------------------------+---------+
| innodb_sort_buffer_size | 1048576 |
| myisam_sort_buffer_size | 8388608 |
| sort_buffer_size        | 8388608 |
+-------------------------+---------+
3 rows in set (0.01 sec)

mysql>

 

 

그리고 다시 해보면 오류 없이 잘 작동하는 것을 볼 수 있당.

 

 

공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2024/05   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
글 보관함