Reputation: 211
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
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
Reputation: 6114
Same thing: use [database];
(the ;
is optional here)
MySQL 5.0 Reference Manual :: 13.8.4 USE Syntax
Upvotes: 1
Reputation: 181280
In MySQL, if you want to change databases, you will also use use
:
mysql> use DNNAME;
Upvotes: 2