MySQueaL Resources

resources for mysql admins and developers who are squealing for help

More Resources

Main Doc Pages
Comments
MySQL columns: everywhere I look are tables and columns; life is filled with databases of information to be ordered and grouped. (Gondola Poles, Venice, Italy)

USE Statement

This MySQL statement sets the default database MySQL is to use for the current session.

hits past month: 5 ;  last updated: may 4, 2009 - 2:34am ;  parent: Other MySQL Statements & Functions

Syntax

USE database

Explanation

This statement sets the default database MySQL is to use for the current session. This allows the name of the default database to be omitted from statements.

Examples

For instance, db1.table1 can be written as just table1, and db1 is assumed.

USE company_database;

The semicolon may be omitted from the statement. The mysql client can specify a database at start-up through the or option.

Return to Other MySQL Statements & Functions page of our MySQL Documentation