… mysql command-line client? And did you know about the pager command you can give it? It’s pretty useful. It tells mysql to pipe the output of your commands through… command line in the traditional Unix pipe-and-filter manner. What sort of goodies can we think of here? mysql> pager mk-visual-explain PAGER…
Post: Logging your MySQL command line client sessions
… recently wrote about very helpful but often forgotten about “Pager” feature of command line client. There is another one which falls into the… done on production. Moreover you can put tee=/logs/mysql.log in “mysql” section in my.cnf to have logging enabled automatically… the client. If you’re looking to log session beyond MySQL command line client you can check out “script” tool.
Comment: Neat tricks for the MySQL command-line pager
Check my post http://optimmysql.blogspot.com/2008/07/mysql-command-line-pager-mysmartpager.html for a small hack that can do regex based paging.
Comment: Neat tricks for the MySQL command-line pager
… tee file AFTER the pager has completed (and to .mysql_history only after you exit mysql), so getting the last command is impossible via… ( my $line = ) { $out .= $line; } # Log results to a file (always useful) # But only ever save one
open (PAGER_LOG, ‘>/tmp/mysql_pager.log’); print PAGER_LOG…

