사용자 도구

사이트 도구


database:mysql:config

차이

문서의 선택한 두 판 사이의 차이를 보여줍니다.

차이 보기로 링크

양쪽 이전 판 이전 판
다음 판
이전 판
다음 판 양쪽 다음 판
database:mysql:config [2014/06/07 20:12]
kwon37xi [표제]
database:mysql:config [2018/11/09 17:52]
kwon37xi [Client Options]
줄 31: 줄 31:
 </code> </code>
  
 +MySQL Client는 ''protocol=tcp'' 옵션이 없으면 항상 ''/var/run/mysql/mysqld.sock'' 파일을 통해서만 접속한다. 이 경우에 ''%%--%%port=anotherport'' 옵션을 아무리 줘도 무시한다. 명령행에서 ''--protocol=tcp'' 옵션을 줘야한다.
 ===== Connection 갯수 정리 ===== ===== Connection 갯수 정리 =====
   * ''/etc/my.cnf''<code>   * ''/etc/my.cnf''<code>
 +[mysqld]
 max_connections = 250 max_connections = 250
 </code> </code>
줄 50: 줄 52:
   * '' ERROR 2003 (HY000): Can't connect to MySQL server on 'hostname' (111)'' 와 같은 오류가 발생했다.   * '' ERROR 2003 (HY000): Can't connect to MySQL server on 'hostname' (111)'' 와 같은 오류가 발생했다.
   * 이 이유는 ''my.cnf'' 파일에 ''bind-address = 127.0.0.1'' 항목이 있기 때문이다. 이 항목이 있으면 ''127.0.0.1''에서 들어오는 요청만 허용한다.   * 이 이유는 ''my.cnf'' 파일에 ''bind-address = 127.0.0.1'' 항목이 있기 때문이다. 이 항목이 있으면 ''127.0.0.1''에서 들어오는 요청만 허용한다.
-  * 해당 줄을 주석처리하고 다시 시작한다.+  * 해당 줄을 주석 처리하거나 ''bind-address = 0.0.0.0'' 으로 변경하고 다시 시작한다. 
 + 
 +===== com.mysql.jdbc.PacketTooBigException: Packet for query is too large (x > y). You can change this value on the server by setting the max_allowed_packet' variable ===== 
 +MySQL 클라이언트가 MySQL 서버에 전송한 쿼리의 크기가 지나치게 클 때 발생하는 오류. 
 +한 번에 많은 쿼리를 전송해야 할 경우 ''max_allowed_packet=16M'' 형태로 값을 지정해준다.
  
 ===== 모든 쿼리 로그 찍기 Query Log ===== ===== 모든 쿼리 로그 찍기 Query Log =====
 <code> <code>
 +[mysqld]
 general_log_file        = /var/log/mysql/mysql.log general_log_file        = /var/log/mysql/mysql.log
 general_log             = 1 general_log             = 1
 +slow_query_log          = 1
 </code> </code>
  
 +  * ''log-output=FILE|TABLE|NONE'' : File은 파일명을 지정하고, TABLE일 경우에는 ''mysql.general_log'', ''mysql.slow_log''로 쿼리를 저장한다.
 +  * ''general_log''에서 로그 확인<code sql>
 +select * from general_log order by event_time desc limit 100;
 +</code>
database/mysql/config.txt · 마지막으로 수정됨: 2022/12/17 15:56 저자 kwon37xi