MySQL: To see database parameters

 In MySQL, you can view system parameters (also called system variables) using the SHOW VARIABLES statement or by querying the performance_schema tables.

Here are the main ways:

1. Show all system parameters

Sql
SHOW VARIABLES;

This lists every system variable and its current value for your session.

2. Show specific parameters by name pattern

Sql
SHOW VARIABLES LIKE 'max_connections'; SHOW VARIABLES LIKE 'innodb%';
  • % is a wildcard for matching multiple variables.

3. Show global vs session values

Sql
-- Global values (affect all connections) SHOW GLOBAL VARIABLES; -- Session values (specific to your current connection) SHOW SESSION VARIABLES;

4. Using performance_schema

Sql
SELECT * FROM performance_schema.global_variables WHERE VARIABLE_NAME LIKE 'max_connections';

This is useful for more complex filtering or joining with other metadata.

Tip:
If you want to see both the current session and global values for a variable:

Sql
SHOW GLOBAL VARIABLES LIKE 'sql_mode'; SHOW SESSION VARIABLES LIKE 'sql_mode';

Comments

Popular posts from this blog

PeopleSoft: Clean Up PUM

Postgres: Clean up stopped replication slot