MySQL Tutorial
MySQL Installation and Configuration
MySQL Database Operations
Database Design
MySQL Data Types
MySQL Storage Engines
MySQL Basic Operations of Tables
MySQL Constraints
MySQL Operators
MySQL Function
MySQL Manipulate Table Data
MySQL View
MySQL Indexes
MySQL Stored Procedure
MySQL Trigger
MySQL Transactions
MySQL Character Set
MySQL User Management
MySQL Database Backup and Recovery
MySQL Log
MySQL Performance Optimization
The SHOW DATABASES
command in MySQL is used to display a list of all databases on the MySQL server.
Prerequisites:
Tutorial:
To start the mysql
command-line client, open your terminal or command prompt, and enter:
mysql -u [username] -p
Replace [username]
with your MySQL username and enter your password when prompted.
The basic syntax for using the SHOW DATABASES
command is as follows:
SHOW DATABASES;
When you execute this command, MySQL will return a list of all databases on the server.
For example:
mysql> SHOW DATABASES; +--------------------+ | Database | +--------------------+ | information_schema | | mysql | | performance_schema | | sys | | your_database | +--------------------+ 5 rows in set (0.00 sec)
EXIT;
By using the SHOW DATABASES
command in MySQL, you can easily view all the databases on your server. This can be useful for getting an overview of your data or finding the database you want to use or modify.
Displaying Databases with MySQL SHOW DATABASES:
SHOW DATABASES;
SHOW DATABASES;
List All Databases in MySQL Using SHOW DATABASES:
SHOW DATABASES;
Filtering Databases with SHOW DATABASES in MySQL:
SHOW DATABASES LIKE 'test%';
Sorting Database Names with SHOW DATABASES in MySQL:
SHOW DATABASES ORDER BY Database;
MySQL SHOW DATABASES and Character Sets:
SHOW DATABASES CHARACTER SET utf8;
Displaying Additional Information with SHOW DATABASES in MySQL:
SHOW DATABASES FULL;
Checking Permissions with SHOW DATABASES in MySQL:
SHOW DATABASES;
MySQL SHOW DATABASES and Wildcards:
SHOW DATABASES LIKE 'data%';
MySQL SHOW DATABASES and Stored Procedures:
SHOW DATABASES
.CALL ShowDatabases();