Which command is used to view the existing databases on the mysql?

In this post, you will learn how to use the MySQL SHOW DATABASES command to list all existing databases in a MySQL database server.

Using the MySQL SHOW DATABASES Command

To list all the existing databases on a MySQL server host, you use the SHOW DATABASES command as follows:
SHOW DATABASES;

For example, to list all databases in the local MySQL database server, first you need to login to the database server as follows:

>mysql -u root -p
Enter password: **********
MySQL>
Code language: SQL (Structured Query Language) (SQL)

And then use the SHOW DATABASES command:


mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| ecommerce          |
| ems                |
| information_schema |
| mysql              |
| performance_schema |
| sys                |
+--------------------+
6 rows in set (0.00 sec)

Free Spring Boot Tutorial - 5 Hours Full Course


Watch this course on YouTube at Spring Boot Tutorial | Fee 5 Hours Full Course

Comments