2013-04-20 61 views
0

我試圖創建一個數據庫「 - 」文字兩者之間,它應該工作完全正常,但事實並非如此。這裏是日誌文件:名字似乎有效,但它顯示一個錯誤

mysql> create database test1; 
Query OK, 1 row affected (0.00 sec) 

mysql> show databases 
    -> ; 
+-----------------------+ 
| Database    | 
+-----------------------+ 
| information_schema | 
| mifos     | 
| mifosplatform_tenants | 
| mifostenant   | 
| mifostenant_default | 
| mysql     | 
| performance_schema | 
| sakila    | 
| test     | 
| test1     | 
| testing    | 
| world     | 
+-----------------------+ 
12 rows in set (0.00 sec) 

mysql> create database test1-mohit; 
ERROR 1064 (42000): 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 '-mohi 
t' at line 1 
+0

不能在數據庫名稱中使用連字符 – 2013-04-20 04:11:32

回答

1

可以使用_(underscore)

create database test1_mohit; 

或試試這個

create database `test1_mohit`; 

這些都將工作

相關問題