Nice formatting for mysql show variables / show status

Have you ever tried to get a variable out of mysql and your screen fills with dots and dashes from mysql's output? Turns out its pretty simple to get rid of with awk.

# Arrgh!
mysql -e "show variables" | grep innodb

# Much better
mysql -e "show variables" | awk '{print $1 " = " $2}' | grep innodb

That's all.

Leave a Comment