Tuesday, August 21, 2012

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       |
+-----------------+-----------+

Post a Comment