Formatting Output from MySQL prompt

Posted on Wed 23 September 2009 in misc

I'm not the biggest fan of MySQL and on the occasions I do use it I always forgot how to get useful results from my queries. To get results paged to less and have them display vertically, you can do this

mysql> \P less
PAGER set to 'less'

mysql> select\* from blahblah \G