In MySQL database server SHOW DATABASES statement is used to list all existing database. Login to MySQL server with privileged user and list all databases.

Command :-

mysql> SHOW DATABASES;

Example :-

Login to your MySQL server using command line. You will get MySQL database prompt like mysql> . Now use SHOW DATABASES statement to list all database.

mysql> show databases;


+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| mydb               |
| performance_schema |
+--------------------+
4 rows in set (0.03 sec)