I have an intermittent error that I am trying to track, and I would like to capture only MySQL queries that do not result in a rollback. I don’t want a complete general query or binary , because there will be millions of records in the haystack.
Something like this solution , besides MySQL, would be perfect.
TIA,JD
MySQL (, , ). PHP. , mysql_query, , → query(), . (, , false), . .
mysql_query
Zend_DB:
class My_DB extends Zend_DB { public function insert($data) { try { parent::insert($data); } catch (Exception $e) { // put $e->getMessage() to log } } }
, , ...
, mysqlbinlog .
mysqlbinlog
: : http://dev.mysql.com/doc/refman/5.5/en/binary-log.html: http://ronaldbradford.com/blog/mysql-dml-stats-per-table-2009-09-09/
mysqlbinlog, .