Chinesinho
Chinesinho

Reputation: 211

Database context change

Pardon my noob question but was wondering how to change the database context within mysql? I know in SQL Server, it's:

USE [DBName];

so is there an equivalent in mysql?

Upvotes: 1

Views: 1576

Answers (3)

Shaikh Farooque
Shaikh Farooque

Reputation: 2640

The use command switches databases in MySQL. The following line

`use [database];`

will switch between databases, where you substitute the actual name of your database for [database], like use db1;.

Upvotes: 0

newtron
newtron

Reputation: 6114

Same thing: use [database]; (the ; is optional here)

MySQL 5.0 Reference Manual :: 13.8.4 USE Syntax

Upvotes: 1

Pablo Santa Cruz
Pablo Santa Cruz

Reputation: 181280

In MySQL, if you want to change databases, you will also use use:

mysql> use DNNAME;

Upvotes: 2

Related Questions