● general log 상태 확인 및 설정

1) mysql> show variables like 'general%'

2) mysql> show variables where Variable_name in ('version','log','general_log');

 

+------------------+-------------------------------+
| Variable_name    | Value                            |
+------------------+-------------------------------+
| general_log      | OFF                                |
| general_log_file | /var/run/mysqld/mysqld.log |
+------------------+-------------------------------+

 

+---------------+------------+
| Variable_name | Value      |
+---------------+------------+
| general_log   | OFF          |
| log              | OFF          |
| version         | 5.1.73-log  |
+---------------+------------+

 

general_log : 로그 기록유무

general_log_file : 로그 저장될 위치

 

mysql> set  global general_log = on; ( 활성화 )

 

● general log 쌓는 방식 확인 및 설정

mysql> show variables like 'log_output'; ( 확인 )

 

+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| log_output    | FILE    |
+---------------+-------+

mysql> set global log_output='방식' ( FILE 혹은 TABLE )

 

테이블 방식 쌓기일때 비우기 명령

mysql> truncate mysql.general_log;

Posted by 꼬장e
,