Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Show multiple variables according to filter in mysql

Tags:

mysql

mariadb

In mysql/mariadb, I can show variables using SHOW VARIABLES LIKE 'pattern', is it possible to show multiple variables at one time:

SHOW VARIABLES like  'port';
SHOW VARIABLES like  'sql_mode';
like image 440
Nick Avatar asked Mar 03 '16 03:03

Nick


2 Answers

Here is another alternative, with less typing and more compact display of results by using '\G instead of ';' as the query terminator:

SHOW VARIABLES
WHERE Variable_Name IN ('port', 'sql_mode')\G
like image 103
DC Slagel Avatar answered Nov 19 '22 08:11

DC Slagel


Use where

SHOW VARIABLES WHERE 
Variable_Name LIKE 'port' OR 
Variable_Name LIKE 'sql_mode'
like image 40
Jimish Gamit Avatar answered Nov 19 '22 08:11

Jimish Gamit