Computer >> 컴퓨터 >  >> 프로그램 작성 >> MySQL

프로그래밍 방식으로 MySQL에서 max_connections를 설정하는 방법은 무엇입니까?


프로그래밍 방식으로 MySQL에서 max_connections를 설정하려면 SET 명령을 사용할 수 있습니다. 구문은 다음과 같습니다 -

SET GLOBAL max_connections=yourIntegerValue;

위 쿼리를 구현하여 최대 연결 수를 설정해 보겠습니다. 쿼리는 다음과 같습니다 -

mysql> set global max_connections=1000;
Query OK, 0 rows affected (0.04 sec)

show variables 명령을 사용하여 최대 연결이 설정되었는지 확인합니다. 쿼리는 다음과 같습니다.

mysql> show variables like 'max_connections';

다음은 출력입니다.

+-----------------+-------+
| Variable_name   | Value |
+-----------------+-------+
| max_connections | 1000  |
+-----------------+-------+
1 row in set (0.18 sec)