The MySQL SHOW DATABASES
statement is used to list all the databases present in the MySQL server. This statement is essential for viewing the existing databases and confirming database creation.
SHOW DATABASES;
The SHOW DATABASES
statement does not have any optional clauses or parameters. It simply lists all databases available on the MySQL server.
Let's look at an example of the MySQL SHOW DATABASES
statement and how to interpret its output:
SHOW DATABASES;
This query lists all databases on the MySQL server. The result will be a list of all database names available in the MySQL server.
The output of the SHOW DATABASES
statement will be a list of database names. For example:
In this example, the output lists five databases: information_schema
, mysql
, performance_schema
, sys
, and mydatabase
.
The MySQL SHOW DATABASES
statement is a straightforward but powerful tool for listing all databases on the MySQL server. Understanding how to use this statement is essential for database management and verification in MySQL.