MySQL Basic Log

### mysqld
* mysqld start

“`
160114 14:51:46 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
160114 14:51:46 InnoDB: Initializing buffer pool, size = 8.0M
160114 14:51:46 InnoDB: Completed initialization of buffer pool
160114 14:51:46 InnoDB: Started; log sequence number 0 44243
160114 14:51:46 [Note] Event Scheduler: Loaded 0 events
160114 14:51:46 [Note] /usr/libexec/mysqld: ready for connections.
Version: ‘5.1.73-log’ socket: ‘/var/lib/mysql/mysql.sock’ port: 3306 Source distribution
“`

* mysqld shutdown

“`
# 에러나서 종료
160113 15:40:32 [Warning] ‘–log’ is deprecated and will be removed in a future release. Please use ”–general_log’/’–general_log_file” instead.
160113 15:40:32 [Warning] ‘–log-update’ is deprecated and will be removed in a future release. Please use ‘–log-bin’ instead.
160113 15:40:32 [Warning] ‘–log_slow_queries’ is deprecated and will be removed in a future release. Please use ”–slow_query_log’/’–slow_query_log_file” instead.
160113 15:40:32 [ERROR] The update log is no longer supported by MySQL in version 5.0 and above. It is replaced by the binary log.
^G/usr/libexec/mysqld: File ‘/var/log/mysql/mysql-bins.index’ not found (Errcode: 2)
160113 15:40:32 [ERROR] Aborting

160113 15:40:32 [Note] /usr/libexec/mysqld: Shutdown complete

# 정상 종료
160114 14:51:41 [Note] /usr/libexec/mysqld: Normal shutdown

160114 14:51:41 [Note] Event Scheduler: Purging the queue. 0 events
160114 14:51:43 InnoDB: Starting shutdown…
160114 14:51:44 InnoDB: Shutdown completed; log sequence number 0 44243
160114 14:51:44 [Note] /usr/libexec/mysqld: Shutdown complete
“`

* setting error – ERROR

“`
160113 15:40:32 [ERROR] The update log is no longer supported by MySQL in version 5.0 and above. It is replaced by the binary log.
^G/usr/libexec/mysqld: File ‘/var/log/mysql/mysql-bins.index’ not found (Errcode: 2)
160113 15:40:32 [ERROR] Aborting
“`
* setting error – WARNING

“`
160113 15:40:41 [Warning] ‘–log’ is deprecated and will be removed in a future release. Please use ”–general_log’/’–general_log_file” instead.
160113 15:40:41 [Warning] ‘–log-update’ is deprecated and will be removed in a future release. Please use ‘–log-bin’ instead.
160113 15:40:41 [Warning] ‘–log_slow_queries’ is deprecated and will be removed in a future release. Please use ”–slow_query_log’/’–slow_query_log_file” instead.
“`

### mysql query log
* connect

“`
160114 11:00:13 2 Connect [email protected] on mysqltest
2 Query show databases
2 Query show tables
2 Field List dd
2 Query show variables
“`

* database select

“`
160119 16:11:21 8 Query SELECT DATABASE()
8 Init DB mysqltest
8 Query show databases
8 Query show tables
8 Field List dd
8 Field List tableName
8 Field List tableName2
“`

* query – select

“`
160114 15:37:11 2 Query insert into tablename(time) values(20131111)
2 Query select * from tablename
160114 15:37:29 2 Query insert into tablename(time) values(20131111)
2 Query select * from tablename
“`

* query – create

“`
160114 15:29:48 2 Query create table if not exists tablename
160114 15:30:17 2 Query create table if not exists tablename(id int)
160114 11:02:17 2 Query create database asdfqwer
“`

* query – delete

“`
160114 15:37:56 2 Query delete from tablename where time=2013-11-11
160114 15:38:04 2 Query delete from tablename where time=20131111
“`

* query – insert

“`
160114 15:35:37 2 Query insert into tablename(test) values(11111111111111)
160114 15:35:44 2 Query insert into tablename(test) values(111tt)
160114 15:36:08 2 Query insert into tablename(test) values(1111)
2 Query select * from tablename
2 Query –)
160114 15:36:43 2 Query insert into tablename(test) values(1111)
2 Query select * from tablename
160114 15:36:49 2 Query insert into tablename(test) values(11111111111111)
2 Query select * from tablename
160114 15:36:57 2 Query insert into tablename(time) values(11111111111111)
2 Query select * from tablename

“`

* query – update

“`
160119 16:51:51 10 Query update tablename SET time=20020808 WHERE test=1111
“`

* query – alter

“`
160114 15:32:22 2 Query alter table tablename add test
160114 15:33:12 2 Query alter table tablename add column test
160114 15:33:20 2 Query alter table tablename add column test 11
160114 15:33:25 2 Query alter table tablename add column test int
160114 15:33:32 2 Query alter table tablename add column test integer
“`

* query – set

“`
160119 16:43:39 9 Query SET GLOBAL general_log = ‘OFF’
“`

* query – drop

“`
160114 15:29:26 2 Query drop table if exists tablename
160114 11:02:22 2 Query drop database asdfqwer
2 Query SELECT DATABASE()
“`

### mysql-slow
* 설정한 시간 이상 지연된 쿼리
“`
# Time: 160119 16:11:31
# [email protected]: root[root] @ localhost []
# Query_time: 8.000282 Lock_time: 0.000000 Rows_sent: 1 Rows_examined: 0
use mysqltest;
SET timestamp=1453187491;
select sleep(8);
“`