[MySQL] MySQL 최대 접속수 설정하기
MySQL 최대 접속수 설정하기
ERROR 1040 (08004): Too many connections 에러발생시 해결법
mysql을 재시작 하지 않고 바로 설정 방법
#mysql 을 재시작 안해도 max_connections 값이 바로 적용된다. mysql> set global max_connections=300;
mysql 설정파일(my.ini 또는 my.cnf ) 방법
#mysql을 재시작 해 주어야 한다. [mysqld] max_connections = 300
MySQL 접속수 관련 상태를 확인하는 방법
mysql> show variables like '%max_connect%'; +--------------------+-------+ | Variable_name | Value | +--------------------+-------+ | max_connect_errors | 10000 | | max_connections | 100 | +--------------------+-------+ mysql> show status like '%CONNECT%'; +--------------------------+-------+ | Variable_name | Value | +--------------------------+-------+ | Aborted_connects | 200 | | Connections | 300 | | Max_used_connections | 101 | ==> 현재 연결된 접속수 | Ssl_client_connects | 0 | | Ssl_connect_renegotiates | 0 | | Ssl_finished_connects | 0 | | Threads_connected | 101 | ==> 연결되었던 최대 접속수 +--------------------------+-------+ 7 rows in set (0.00 sec)
※ max_connections에 대한 설명
MySQL은 [ 최대 접속수 + 1 ]의 접속을 허용한다. "1"은 관리자 권한 접속을 나타낸다.
문제가 발생했을 경우 관리자가 접속할 수 있게 하기 위해서이다.
댓글 0
댓글 남기기