June 27th, 2025 at 8:33 pm
Show Databases: A Step-by-Step Guide for Command Line and cPanel
7 minutes reading

You’re trying to fix a database connection error. Or maybe you’re installing a new app, and the installer asks you to select a database. Choosing the wrong database name can lead to broken installations or access errors. Thus, precision matters.
Even if you followed our naming tips from the ‘How to Create Database in MySQL Command Line’ guide, it’s still wise to double-check the name by asking MySQL to show databases.
For many beginners, this is where MySQL becomes intimidating. You didn’t sign up to be a database admin. You just want to run your website, manage your content, or launch your online store. However, without knowing how to list your MySQL databases, you’re left to guess. That’s risky and impractical.
To help you get through this otherwise easy process, we created an extensive guide on how to extract a list both in the Command line and cPanel.
So, regardless of whether you’re cleaning up unused databases, verifying an installation, or just trying to learn the basics, this is a core skill every site owner should have.
Why You Might Need to List Databases
You may think that using the show databases command is strictly reserved for dev teams or at least system administrators. However, that’s something every website owner must know, and there are at least four good reasons for that.
1. To Confirm Database Names
If you’re installing software like WordPress or Magento, you’re often asked to provide the exact name of the database. A single typo can cause the installation to fail. Listing your databases helps you avoid that frustration by giving you the exact name you need. There’s no guessing.
Of course, if you’re using a hosting provider with a one-click WordPress installation, you won’t get this problem. But say you want to set up WordPress on localhost, the database name accuracy will be integral.
2. Troubleshooting Errors
Ever seen the dreaded “Error establishing a database connection” message? It’s one of the most common issues in web hosting. One of the first steps in troubleshooting is to ensure the database actually exists and is named correctly.
Now, you can always call on your hosting provider’s support to check it out. However, if they don’t offer 24/7/365 support, like the best hosting providers on the market, and if they respond within 24 hours instead of within an hour, it’s better to be able to troubleshoot this problem yourself. At least then, when you finally contact the support team, you can already tell them where the problem is or if they can skip this first step.
3. To Clean Up Unused Databases
Over time, your server can collect test databases, duplicate installations, or abandoned projects. If you don’t regularly check what’s there, these can eat up space and clutter your environment. Listing all databases makes it easy to identify and delete what you no longer need.
4. To Audit Security or User Permissions
If multiple people have access to your hosting account or you’ve worked with freelancers in the past, listing your databases gives you visibility into everything that’s been created. You can then review which databases are still in use and which may pose a security risk.
In our experience, website owners with basic MySQL knowledge are far less prone to internal breaches and attacks. Setting permissions is like giving keys to your building. You don’t want people who don’t work with money to have access to your financial documents, now do you? The same principle applies to database permissions. You don’t want freelancers to have access to your customer-facing website when they can complete all the necessary tasks in a staging environment.
Show Databases with Command Line: A Step-by-Step Guide
The command line is, without a doubt, the fastest way to list your MySQL databases. Unfortunately, it’s not the easiest. However, if you want to take full control over your server and, of course, your information, this is knowledge you must have.
While the cPanel is definitely easier, using the command line only looks intimidating. In fact, listing your MySQL database is quite simple once you know the proper steps.
First: Access the MySQL Shell
Open your terminal and connect to your MySQL server. The basic command is:
MySQL -u your_username -p
Replace your username with your actual MySQL username. After pressing Enter, you’ll be prompted to enter your MySQL password. If the credentials are correct, you’ll enter the MySQL shell, indicated by a prompt like:
mysql>
Second: Use the Show Databases Command
Once you’re inside, run:
SHOW DATABASES;
This simple yet powerful command displays all databases your MySQL user account has permission to see.
You’ll get an output like:
+--------------------+
| Database |
+--------------------+
| information_schema |
| my_database |
| test_db |
+--------------------+
That’s it. You now have a complete list of available databases.
However, if your list is too long or includes unfamiliar names, you can check database creation dates and sizes using additional queries or external tools. But for most beginners, the SHOW DATABASES; command is more than enough.
Using cPanel to Show Databases
Thankfully, the command line way is not the only one. There is a far easier option, especially if you’re a HostArmada user. With our cPanel, you can get to your database list through a visual, beginner-friendly interface. IT let’s you view and manage your MySQL databases without touching a single line of code.
So, here’s how to do it:
Step 1: Logging into cPanel
The easiest way to get there is through your Client Area. Once you’re in the dashboard, go to the “My Services” section. Under it, you will see all the web hosting services you have. Click on the “cP” icon.

If you need a more detailed instruction on how to get to the cPanel, check out our dedicated guide on Accessing cPanel
Step 2: Find the Databases Section
Once you’re inside, scroll down to the Databases section and click on MySQL Databases. This is where you can create, manage, and view all MySQL-related settings.

Final step: Scroll to “Current Databases”
On the MySQL Databases page, scroll down until you see a section labeled Current Databases. This is where you can find a complete list of all MySQL databases created under your hosting account.
You’ll also see extra details like which database user is assigned to each one, what privileges they have, and quick options to rename or delete them.

For a full walkthrough of what else you can do in this section, check out our guide on getting started with MySQL.
If you’re more comfortable with a graphical interface, phpMyAdmin is another great option. From cPanel, click phpMyAdmin, and you’ll instantly see all your databases listed in the left sidebar.
What Permission-Based Limitations You Can Encounter
Just typing the SHOW DATABASE command doesn’t always mean you’ll see every database. My SQL permissions control what each user is allowed to access. So, if your account doesn’t have the proper privileges, you won’t get to see the database list.
Here are a few limitations you may encounter when dealing with MySQL databases.
Limited Visibility by Default
If you log in with a standard MySQL user account, you’ll only see databases that the account has access to. For example, if your website runs on a single database, and your user is assigned only to that one, running SHOW DATABASES; will return just that entry.
And while we often hear, “Please fix that bug,” we can assure you this is normal. Moreover, it’s not a bug; it’s a security feature.
The Information_schema Outcome
Some users are surprised to see only one or two databases listed. Others, however, will only see:
information_schema
That usually means your user doesn’t have access to any actual application databases. In that case, you’ll need to use a higher-privilege MySQL account or contact your hosting provider to check access levels.
How to Avoid Access Issues
If you’re unsure which MySQL user has permission to access which databases, check your user assignments in cPanel’s MySQL Databases section. There, you can add users to databases and assign privileges like SELECT, INSERT, or ALL PRIVILEGES.
While it may be tempting to assign all accounts with all privileges, that’s hardly a secure way to handle your databases.
Also, note that on shared hosting accounts, you may not be able to access global or system databases even if you’re the primary user. This is because the hosting provider must protect other server users from accidentally deleting their databases. So, if you’re using shared hosting and you have an issue with your database, your best bet is to simply ask the hosting provider to assign you the right permissions.
SHOW DATABASES Not Working? Here’s What’s Going On
You typed everything right, hit Enter… and nothing useful shows up. It’s frustrating, but it happens. So, don’t rage call your hosting provider’s support. First, check if you have accidentally stumbled on one of the most common Show Databases errors.
1. Error:1045 – Access Denied
This usually happens when your login credentials are incorrect. Either the username doesn’t exist, or the password was mistyped.
Fix:
Double-check your command:
mysql -u your_username -p
Make sure the user exists in MySQL and that you’re typing the correct password when prompted.
2. No Database or Error Message Showing
If SHOW DATABASES; runs without any errors but only shows information_schema, that means your MySQL user doesn’t have permission to view other databases.
Fix:
Log in with a user that has the correct privileges or check user assignments inside cPanel. You can also reassign permissions in the MySQL Databases section.
3. Command Not Found
This appears when MySQL isn’t installed or your server doesn’t recognize mysql as a command.
Fix:
Make sure MySQL is installed and added to your system’s PATH variable. On shared hosting, ensure your host supports SSH and CLI access.
4. Syntax Errors
Even a missing semicolon can break the command:
SHOW DATABASES
is wrong
This is how your command should look like:
SHOW DATABASES;
5. Wrong Host or Port (for Remote Connections)
Trying to connect remotely? You might get timeout errors if your host, port, or firewall settings are misconfigured.
Fix:
Make sure you’re connecting to the right IP, using the correct port (default is 3306), and that remote access is enabled.
Want to Learn More? Start with the Right Foundation
Listing your databases might seem like a small task, but it plays a big role in how you manage and secure your website. Whether you’re installing new software, cleaning up your server, or just trying to troubleshoot an error, knowing how to run the SHOW DATABASES command or where to find the info in cPanel puts you behind the wheel.
However, there’s much more to learn, especially if you’re just starting. Check out our full MySQL database tutorial to explore everything from creating databases to performance tips and advanced management tools.
At HostArmada, we believe web hosting shouldn’t be confusing. That’s why, along with our lightning-fast website loading speed, top-of-the-line security, and 99.9% uptime guarantee, we build our hosting environment beginner-friendly and fully optimized for MySQL-powered websites.
So, don’t hesitate to check out our hosting plans. This is the first step in taking control of your website. For the rest, you can always follow our blog and learn everything there is to know for running a successful website.