Go2Linux | Linux Operating System

A site dedicated to: Linux Operating System

How to list or show databases in MySQL

Date: 2010-11-22 00:00:00 -0400

MySQL Logo

Continuing with some basic MySQL tips, we will now see how to list / Show databases.

We will use the command line to do this. First you need to connect the server son at the Linux command line prompt enter:

mysql -u root -p

I’m using root in this example, but you can use any user you have access to.

Next the server is going to ask for your password, and once you enter it you will the mysql prompt.

mysql>

At the prompt enter:

show databases;

All databases your use has access to, will then be listed, something like this:

+--------------------+
| Database           |
+--------------------+
| information_schema |
| css-database       |
| wordpress1         |
| guillermo          |
+--------------------+
6 rows in set (0.00 sec)

Now if you want to use one of the at the mysql prompt enter:

use [database];

In this example we can do:

use guillermo;

Now you can work with that database.

If you liked this article please share it.

powered by TinyLetter

If you want to contact me in any other way, please use the contact page.