0

Yesterday I installed and ran mysql and used it to create a DB called "classicmodels".

I then connected to it using SQLDeveloper and tried to run a query to SELECT * from a table just to make sure things were working. When I did this it thew a "no database selected" error. The solution was to run USE(classicmodels); before trying to run queries and this worked.

Today, I started SQLDeveloper back up again and tried to run a query and the same problem occured. This time, though, when trying to run the same command USE(classicmodels); I get this error:

Error starting at line 1 in command:
USE(classicmodels)
Error at Command Line:1 Column:1
Error report:
SQL Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(classicmodels)' at line 1

My questions are:

  • Why is this happening?
  • How do I fix it?
4

1 回答 1

2

这是一个 SQL 语法错误;不带括号使用它,例如:

USE classicmodels;

这不能解释为什么它第一次没有工作,但我(礼貌地)猜测你当时使用了不同的东西。

于 2012-10-14T21:10:59.730 回答