Want a list of MySQL databases? In this quick guide, I demonstrate how to show a list of databases in MySQL using SHOW DATABASES.
First, login as user root to your MySQL instance.
mysql -uroot -pYourPassword
Now that you are logged in, you simply need to run the SHOW DATABASES command.
SHOW DATABASES;
Produces the following list.
+--------------------+ | Database | +--------------------+ | information_schema | | mysql | | test | +--------------------+
As I am logged in as root, I can see all databases. If you run this as another user, you will only see the databases that the user has access to.
You can also look for specific databases which is useful if your server contains many databases.
SHOW DATABASES LIKE 'mysql';
+------------------+ | Database (mysql) | +------------------+ | mysql | +------------------+ 1 row in set (0.00 sec)
Or you can use a wildcard to look for databases containing specific text.
SHOW DATABASES LIKE 'my{3a76cbff1b5ce5ace3bd34bbdd68f71285d81fb9af60114c7a6db80d3a8688de}';
+----------------+ | Database (my{3a76cbff1b5ce5ace3bd34bbdd68f71285d81fb9af60114c7a6db80d3a8688de}) | +----------------+ | mysql | +----------------+ 1 row in set (0.00 sec)
How to Show MySQL databases in MySQL Workbench
There are two ways, those listed above as seen here
And you can also browse a list of available MySQL schemas but this does not include databases such as mysql or performance_schema
Leave a Reply