pertrai1
pertrai1

Reputation: 4318

console use db use error

I am working in the mysql console and trying to use a db that has a naming convention that is so: xxx-xxxx. When I try to use the db I get an error and it seems to be that the "-" is the cause of the issue. I run mysql use xxx-xxxx and get the error. How would I overcome this so I can use the db?

Upvotes: 0

Views: 29

Answers (1)

knittl
knittl

Reputation: 265241

You can quote mysql names (tables, columns, databases) with backticks.

So the query

use `xxx-xxxx`;

should work for you.

Upvotes: 2

Related Questions