david
david

Reputation: 45

How to correct the error message-No database selected

I have installed mysql. I have one database called first.db in c:\mysql. In dos prompt I switched to c:\mysql. In mysql prompt I issued select * from firstable; I get the error message-No database selected. How to solve it. Thanks in advance.(firstable is a table in first.db).

Upvotes: 0

Views: 55

Answers (3)

Selçuk Pekşen
Selçuk Pekşen

Reputation: 3

Use DatabaseName

Select * From TableName

Upvotes: 0

budirec
budirec

Reputation: 288

You can set the active database by this command.

Use nameofdatabase;

Or modify your query to

SELECT * FROM nameofdatabase.table

Upvotes: 1

user2460074
user2460074

Reputation: 1272

You need to tell MySQL which database to use :

USE database_name;

Upvotes: 2

Related Questions