… lines. I modified it as follows: mysql> pager grep -v ‘\-\+\-’ | grep -v ” Id[ |]*User ” | awk -F ‘|’ ‘{print $6}’ | sort | uniq -c | sort -r PAGER set to ‘grep -v ‘\-\+\-’ | grep -v ” Id[ |]*User ” | awk -F ‘|’ ‘{print $6}’ | sort | uniq -c | sort -r’ mysql> show processlist; 5 Sleep 2 Connect 1 Query 8 rows in set (0.00 sec) No more entries for ‘Command‘ or…
Post: Be productive with the MySQL command line
… to connect to your MySQL servers, one day or another, you will have to deal with the command line. So it is nice… command line client works: it just outputs all results. It can be annoying but it is easily solved by using the pager command: mysql> pager more PAGER…, you will see a copy of your session. Conclusion The mysql command line client is not as glossy as most of the graphical…
Post: Neat tricks for the MySQL command-line pager
… 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.
Post: Fun with the MySQL pager command
… when using the command line on Unix. Today I want to focus more on pager. The most common usage of pager is to set… custom pager, this is easy, just run pager: mysql> pager Default pager wasn’t set, using stdout. Or \n: mysql> \n PAGER set to stdout But the pager command… writing SQL queries, while others will prefer command line tools Conclusion As you can see, pager is your friend! It’s very easy…
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…

