How to List All Databases in MySQL

We will show you how to list all databases in MySQL. MySQL is an open-source relational database management system commonly used with web based applications like WordPress, Magento etc. In this tutorial we will show you how to list all databases in MySQL on a Linux VPS.

Next, to connect to the MySQL database server through the command line as user root run the following command:

mysql -u root -p

MySQL will ask you to enter the password for the MySQL root user. Enter the password and press Enter. If you haven’t already set up password for the MySQL root user, you can use the following command:

mysql -u root

Of course, it is always recommended to keep your services secure, so if you haven’t set up the MySQL root password yet, you can do that now using the mysql_secure_installation command without arguments:

mysql_secure_installation

Then, answer the security questions as follows:

Would you like to setup VALIDATE PASSWORD plugin?
Press y|Y for Yes, any other key for No: y
Please set the password for root here.
New password:
Do you wish to continue with the password provided?(Press y|Y for Yes, any other key for No) : y
Remove anonymous users? (Press y|Y for Yes, any other key for No) : y
Disallow root login remotely? (Press y|Y for Yes, any other key for No) : y
Remove test database and access to it? (Press y|Y for Yes, any other key for No) : y
Reload privilege tables now? (Press y|Y for Yes, any other key for No) : y
All done!

Then, connect to the MySQL database server using the MySQL root user and enter your new root password.

Of course, you don’t have to list all tables in MySQL, if you are using one of our MySQL VPS Hosting services, in which case you can simply ask our expert Linux admins to help you. They are available 24×7 and will take care of your request immediately.

PS. If you liked this post on how to list all databases in MySQL on a Linux VPS, please share it with your friends on the social networks using the buttons on the left or simply leave a reply below. Thanks.