Select a MySQL database to use

Home -> Database -> MySQL

39785 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

A single instance of MySQL can hold many separate databases. It is important to specify the database to which subsequent commands will be issued.

From within the mysql command (see Connect to a MySQL server using the mysql command for more information), the 'use' command selects the named database for use:

use financial


This command will select the database named 'financial' for use. Subsequent SQL commands will affect this database. The use command must be used on a separate line with no additional SQL commands.

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:

  Display a list of databases on a MySQL server
  Create a MySQL database
  Connect to a MySQL server using the mysql command
  Drop or delete a table in MySQL
  MySQL - Daily database dumps, all nicely sorted.
  Create a MySQL user account
  Describe the column structure of a MySQL table
  Copy an existing MySQL table to a new table
  Solve: Can't connect to local MySQL server through socket /tmp/mysql.sock
  Show or list tables in a MySQL database

 

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.