MySQL

MySQL IntroductionComment MySQLInstall MySQL container with Docker-ComposeMySQL AdminMySQL ALTER TABLEMySQL ArithmeticMySQL BackticksMySQL Backup using mysqldumpMySQL Change PasswordMySQL Character Sets and CollationsMySQL clientMySQL ClusteringMySQL Configuration and tuningMySQL Connecting with UTF-8 Using Various Programming language.MySQL Converting from MyISAM to InnoDBMySQL Create New UserMySQL Creating databasesMySQL Customize PS1MySQL Data TypesMySQL Date and Time OperationsMySQL Dealing with sparse or missing dataMySQL DELETEMySQL Drop TableMySQL Dynamic Un-Pivot Table using Prepared StatementMySQL ENUMMySQL Error 1055: ONLY FULL GROUP BY: something is not in GROUP by clause ...MySQL Error codesMySQL EventsMySQL Extract values from JSON typeMySQL Full-Text searchMySQL Group byMySQL Handling Time ZonesMySQL Indexes and KeysMySQL INSERTMySQL JoinsMySQL JOINS: Join 3 table with the same name of id.MySQL JSONMySQL Limit and OffsetMySQL LOAD DATA INFILEMySQL LOCK TABLEMySQL Log filesMySQL Many-to-many Mapping tableMySQL MyISAM EngineMySQL mysqlimportMySQL NULLMySQL One to ManyMySQL ORDER byMySQL PartitioningMySQL Performance TipsMySQL Performance TuningMySQL Pivot queriesMySQL PREPARE StatementsMySQL Recover from lost root passwordMySQL Regular ExpressionsMySQL ReplicationMySQL Reserved WordsMySQL Security via GRANTsMySQL SELECTMySQL Server InformationMySQL SSL Connection SetupMySQL Stored routines (procedures and functions)MySQL String operationsMySQL Table CreationMySQL Temporary TablesMySQL Time with subsecond precisionMySQL TransactionMySQL TRIGGERSMySQL UNIONMySQL UnionsMySQL UPDATEMySQL Using VariablesMySQL VIEWRecover and reset the default root password for MySQL 5.7+



MySQL Server Information

From WikiOD

Parameters[edit | edit source]

Parameters Explanation
GLOBAL Shows the variables as they are configured for the entire server. Optional.
SESSION Shows the variables that are configured for this session only. Optional.

SHOW VARIABLES example[edit | edit source]

To get all the server variables run this query either in the SQL window of your preferred interface (PHPMyAdmin or other) or in the MySQL CLI interface

SHOW VARIABLES;

You can specify if you want the session variables or the global variables as follows:

Session variables:

SHOW SESSION VARIABLES;

Global variables:

SHOW GLOBAL VARIABLES;

Like any other SQL command you can add parameters to your query such as the LIKE command:

SHOW [GLOBAL | SESSION] VARIABLES LIKE 'max_join_size';

Or, using wildcards:

SHOW [GLOBAL | SESSION] VARIABLES LIKE '%size%';

You can also filter the results of the SHOW query using a WHERE parameter as follows:

SHOW [GLOBAL | SESSION] VARIABLES WHERE VALUE > 0;

SHOW STATUS example[edit | edit source]

To get the database server status run this query in either the SQL window of your preferred interface (PHPMyAdmin or other) or on the MySQL CLI interface.

SHOW STATUS;

You can specify whether you wish to receive the SESSION or GLOBAL status of your sever like so: Session status:

SHOW SESSION STATUS;

Global status:

SHOW GLOBAL STATUS;

Like any other SQL command you can add parameters to your query such as the LIKE command:

SHOW [GLOBAL | SESSION] STATUS LIKE 'Key%';

Or the Where command:

SHOW [GLOBAL | SESSION] STATUS WHERE VALUE > 0;

The main difference between GLOBAL and SESSION is that with the GLOBAL modifier the command displays aggregated information about the server and all of it's connections, while the SESSION modifier will only show the values for the current connection.

Credit:Stack_Overflow_Documentation