1. Home
  2. SQL
  3. MySQL Tutorial
  4. MySQL – Show Databases

MySQL – Show Databases

Use SHOW DATABASES statement to list all database on MySQL database server. First login to MySQL server with privileged user and list all databases.

Command:-

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)

You can also use the following command directly on operating system command prompt without login to MySQL first.

$ mysqlshow -u root -p
Tags , ,