Display multiple variables in mysql

Sometimes you might need to gather a handful of variables in one statement. This can be done by using the following syntax:

james@ebony ~ $ mysql -uroot -p ebonydb -e "show variables where 
variable_name like 'long_query_time' 
or variable_name like 'read_only'"
| Variable_name   | Value     |
| long_query_time | 10.000000 |
| read_only       | OFF       |

1 comment:

Anonymous said...

Thank you James. So simple yet exactly what I needed today.

Hope things are going well for you.