log 파일 위치 디렉터리 소유는 mysql 이여야 한다.
chown mysql.mysql /user/db_backup/log
디렉터리소유권을 주지 않으면, log가 쌓이지 않는다.
--log = 쿼리 로그 설정 - defualt
--log-slow-queries = 슬로우 쿼리 로그 설정
--log-error = 에러로그 설정
--log-bin = 바이너리로그 설정
--log-update = 업데이트 쿼리 설정
1.
--log-error[=file_name]
에러와 스타트업 메시지를 이 파일에 로그한다. 파일 이름을 생략하면, MySQL은 host_name.err를 사용한다. 파일 이름에 확장자가 없으면, 서버는 .err를 확장자에 추가한다.
5.10.2. The General Query Log
If you want to know what happens within mysqld, you should start it with the --log[=file_name] or -l [file_name] option. If nofile_name value is given, the default name is host_name.log This logs all connections and statements to the log file. This log can be very useful when you suspect an error in a client and want to know exactly what the client sent to mysqld.
Older versions of the mysql.server script (from MySQL 3.23.4 to 3.23.8) pass a --log option to safe_mysqld to enable the general query log. If you need better performance when you start using MySQL in a production environment, you can remove the --logoption from mysql.server or change it to --log-bin. See Section 5.10.4, “The Binary Log”.
mysqld writes statements to the query log in the order that it receives them. This may be different from the order in which they are executed. This is in contrast to the update log and the binary log, which are written after the query is executed, but before any locks are released. (The query log also contains all statements, whereas the update and binary logs do not contain statements that only select data.)
Server restarts and log flushing do not cause a new general query log file to be generated (although flushing closes and reopens it). On Unix, you can rename the file and create a new one by using the following commands:
shell> mv hostname.log hostname-old.log
shell> mysqladmin flush-logs
shell> cp hostname-old.log to-backup-directory
shell> rm hostname-old.log
'工夫 > mysql' 카테고리의 다른 글
mysql 5.5 variables (0) | 2014.07.05 |
---|---|
mysql show 명령어 (0) | 2014.07.05 |
댓글