MOCKSTACKS
EN
Questions And Answers

More Tutorials









MYSQL Server Information

SHOW VARIABLES example


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


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.

Conclusion

In this page (written and validated by ) you learned about MYSQL Server Information . What's Next? If you are interested in completing MYSQL tutorial, your next topic will be learning about: MYSQL SSL Connection Setup.



Incorrect info or code snippet? We take very seriously the accuracy of the information provided on our website. We also make sure to test all snippets and examples provided for each section. If you find any incorrect information, please send us an email about the issue: mockstacks@gmail.com.


Share On:


Mockstacks was launched to help beginners learn programming languages; the site is optimized with no Ads as, Ads might slow down the performance. We also don't track any personal information; we also don't collect any kind of data unless the user provided us a corrected information. Almost all examples have been tested. Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content. By using Mockstacks.com, you agree to have read and accepted our terms of use, cookies and privacy policy.