테스트 사이트 - 개발 중인 베타 버전입니다

헉 순간 접속자로 DB가 터짐.. 채택완료

그누스트랩 4년 전 조회 3,432

Warning: mysqli_connect(): (42000/1203): User xabcdagency already has more than 'max_user_connections' active connections in /xabcdagency/www/lib/common.lib.php on line 1675 Connect Error: User xabcdagency already has more than 'max_user_connections' active connections

 

 

출석체크때문에 00:00되면 다들 누르는것때문에 ㄷㄷ;; 이거

max유저 늘리는건 어디서 하나요??

</strong></p>

<p>// DB 연결

function sql_connect($host, $user, $pass, $db=G5_MYSQL_DB)

{

    global $g5;</p>

<p>    if(function_exists('mysqli_connect') && G5_MYSQLI_USE) {

        $link = mysqli_connect($host, $user, $pass, $db);</p>

<p>        // 연결 오류 발생 시 스크립트 종료

        if (mysqli_connect_errno()) {

            die('Connect Error: '.mysqli_connect_error());

        }

    } else {

        $link = mysql_connect($host, $user, $pass);

    }</p>

<p>    return $link;

}</p>

<p><strong>

댓글을 작성하려면 로그인이 필요합니다.

답변 1개

채택된 답변
+20 포인트
JYoung
4년 전

MySQL max_connections 설정을 말하시는 건가요?

 

아래처럼 쉘로 접속을 해서 하셔야 해요~

 

1. # mysql -uroot -p  -> mysql 로그인 2.  mysql> show variables like 'max_connections';  -> 기존 확인 3.  mysql> set global max_connections=500;  -> 적용 4.  mysql> show variables like 'max_connections'; -> 적용 확인

 

또는 영구 적용시 

 

1. # vi /etc/my.cnf   -> mysql 환경설정 수정 2.  [mysqld] max_connections = 500  -> 라인적용 3. # service mysqld restart -> 서비스 재시작 4. # mysql -uroot -p  -> mysql 로그인 5.   mysql> show variables like 'max_connections';  -> 적용 확인

이상입니다~  

로그인 후 평가할 수 있습니다

답변에 대한 댓글 1개

그누스트랩
4년 전
오호 그렇군요잉~

댓글을 작성하려면 로그인이 필요합니다.

답변을 작성하려면 로그인이 필요합니다.

로그인