[root@zetadb ~]# mysql -uroot -p
... (생략)
mysql> show variables like 'max_connections';
+-----------------+-------+
| Variable_name | Value |
+-----------------+-------+
| max_connections | 151 |
+-----------------+-------+
1 row in set (0.00 sec)
(→확인) |
(→확인) |
||
22번째 줄: | 22번째 줄: | ||
1 row in set (0.00 sec) | 1 row in set (0.00 sec) | ||
</source> | </source> | ||
:→ max_connections 설정이 151인데 152개의 커넥션 발생 (Too many connections) | |||
==온라인 설정== | ==온라인 설정== |
2015년 6월 24일 (수) 15:51 판
- MySQL max_connections 설정
1 확인
Copy
Copy
mysql> show status like 'Max_used_connections';
+----------------------+-------+
| Variable_name | Value |
+----------------------+-------+
| Max_used_connections | 152 |
+----------------------+-------+
1 row in set (0.00 sec)
- → max_connections 설정이 151인데 152개의 커넥션 발생 (Too many connections)
2 온라인 설정
- 즉시 적용됨
Copy
mysql> set global max_connections=500;
Query OK, 0 rows affected (0.00 sec)
3 확인 2
Copy
mysql> show variables like 'max_connections';
+-----------------+-------+
| Variable_name | Value |
+-----------------+-------+
| max_connections | 500 |
+-----------------+-------+
1 row in set (0.00 sec)
4 영구 설정
- my.cnf에 max_connections 설정 추가
- mysqld 재시작시에 적용됨
Copy
[root@zetadb ~]# vi /etc/my.cnf
Copy
[mysqld]
max_connections = 500
5 확인 3
- 가능하면 MySQL 재시작하여 다시 확인
Copy
[root@zetadb ~]# service mysqld restart
Stopping mysqld: [ OK ]
Starting mysqld: [ OK ]
Copy
[root@zetadb ~]# mysql -uroot -p
... (생략)
mysql> show variables like 'max_connections';
+-----------------+-------+
| Variable_name | Value |
+-----------------+-------+
| max_connections | 500 |
+-----------------+-------+
1 row in set (0.00 sec)
6 같이 보기
7 참고 자료
편집자 Jmnote Jmnote bot 175.113.182.190
로그인하시면 댓글을 쓸 수 있습니다.
- 분류 댓글:
- MySQL (5)
CentOS MySQL 설치 ― …MySQL BigDump ― JmnoteMySQL STRICT TRANS TABLES ― John JeongMySQL 외래키 옵션 변경 ― 문태부MySQL 컬럼명으로 테이블 찾기 ― Stly3466