Display a list of databases on a MySQL server

Home -> Database -> MySQL

67249 views

From the computer of: qmchenry (339 recipes)
Created: Dec 14, 2003     Updated: Jul 18, 2004


Add a comment

Add to:
Add to stumbleuponAdd to del.icio.usDigg itAdd to FURL

To list the databases that exist in a MySQL server, use the 'show databases' SQL command:

show databases;
+-----------------+
| Database        |
+-----------------+
| financial       |
| mysql           |
| test            |
+-----------------+


The mysql database holds user priviledge information and is required for operation of MySQL. The command can be issued from any SQL source including an application with database connectivity (i.e., PHP, Java, etc.) or directly from mysql command (see Connect to a MySQL server using the mysql command for more information).

Subscribe to the Tech-Recipes Newsletter

You can get tips like this delivered in your email every week!

Enter your Email

We will never, ever sell your email address or spam you.





Related recipes:

  Connect to a MySQL server using the mysql command
  Select a MySQL database to use
  Solve: Can't connect to local MySQL server through socket /tmp/mysql.sock
  Determine the version of MySQL server
  Drop or delete a table in MySQL
  Create a MySQL database
  Describe the column structure of a MySQL table
  Use regular expressions in MySQL SELECT statements
  Create a basic MySQL table
  MySQL - Daily database dumps, all nicely sorted.

 

Sponsored links

 

Login

Nickname

Password

Don't have an account yet? You can create one. As a registered user you have some advantages like theme manager, comments configuration and post comments with your name.