Introduction

In this tutorial, I am going to explain MySQL Help and Show Commands with examples.

In MySQL, we have to use many commands. Some commands are used to show statements. These commands provide general information related to our database. The output from the show table contains a column of table names. This statement lists any views in the database.

Below are some examples of help and show commands with syntax that provide general information about our database and tables.

SHOW STATEMENTS

  • USE <database_name>;
  • Show databases list the databases name in MySQL.

Syntax

SQL
SHOW DATABASES;

showdatabase

SQL
SHOW DATABASES LIKE '%dml%';

showdatabase

SQL
SHOW TABLES FROM <database_name> LIKE <table_name>;

showtabledata

Show Tables lists the NON-TEMPORARY table's name from a given database.

Syntax

SQL
SHOW TABLES;

tableinvasta

SQL
USE order_by;  
   SHOW COLUMNS FROM <table_name>;

useordertable

DESCRIBE

In MySQL, the describe command shows table functionality.

Syntax

SQL
DESCRIBE <table_name>;

describetable

Help STATEMENTS

SQL
SELECT USER(), NOW(), VERSION(), DATABASE();

helpstatement

SQL
SHOW GRANTS FOR root@localhost;

localhost

SQL
SHOW INDEX FROM emp_info;
SQL
SHOW INDEX FROM emp_info FROM vatsa;
SQL
SHOW PROCESSLIST;

processlist

STATUS

In MySQL, the Status command is used to get the status information from the server.

SQL
SHOW STATUS ;

showstatus

SQL
SHOW TABLE STATUS FROM <database_name>;

statustable

VARIABLES

Show variables show the values of MySQL system variables. Show variable displays the values that are used for new connections to MySQL.

Syntax

SQL
SHOW VARIABLES;

showvariable

Conclusion

In this article, I have discussed the concept of MySQL Help and Show Commands with various examples.

I hope you enjoyed this article. Follow C# Corner to learn more new and amazing things about MySQL.

Thanks for reading this article.