Warningsは時々確認するので、ON/OFFの設定を確認。

mysql> tee my20140829.log
Logging to file 'my20140829.log'
mysql> warnings
Show warnings enabled.
mysql> nowarning
Show warnings disabled.
mysql> \w
Show warnings disabled.
mysql> \W
Show warnings enabled.
mysql> notee
Outfile disabled.
mysql>

エラー表示確認 (Defaultで確認可能)

mysql> select * from TABLE001 order by id desc limit 0,1;
+----+-------------+--------------------+
| id | title       | comment            |
+----+-------------+--------------------+
| 30 | Maintenance | Maintenance 201408 |
+----+-------------+--------------------+
1 row in set (0.33 sec)

mysql> insert into TABLE001(title,comment) values('Maintenance','Maintenance 20140829');
Query OK, 1 row affected (0.35 sec)

mysql> desc TABLE001;
+---------+------------------+------+-----+---------+----------------+
| Field   | Type             | Null | Key | Default | Extra          |
+---------+------------------+------+-----+---------+----------------+
| id      | int(10) unsigned | NO   | PRI | NULL    | auto_increment |
| title   | varchar(20)      | YES  |     | NULL    |                |
| comment | varchar(100)     | YES  |     | NULL    |                |
+---------+------------------+------+-----+---------+----------------+
3 rows in set (0.00 sec)

mysql> insert into TABLE001(id,title,comment) values(31,'Maintenance','Maintenance 20140829');
ERROR 1062 (23000): Duplicate entry '31' for key 'PRIMARY'
mysql> show warnings;
+-------+------+----------------------------------------+
| Level | Code | Message                                |
+-------+------+----------------------------------------+
| Error | 1062 | Duplicate entry '31' for key 'PRIMARY' |
+-------+------+----------------------------------------+
1 row in set (0.00 sec)

ついでに、Teeで出したファイルも確認。

mysql> system ls
RPM-GPG-KEY.dag.txt  anaconda-ks.cfg  install.log  install.log.syslog  my20140829.log  rpmforge-release-0.5.2-2.el5.rf.i386.rpm
mysql>

[root@HOME001 ~]# cat my20140829.log
mysql> warnings
Show warnings enabled.
mysql> nowarning
Show warnings disabled.
mysql> \w
Show warnings disabled.
mysql> \W
Show warnings enabled.
mysql> notee
[root@HOME001 ~]#