sql - database name in mysql seems valid but it is showing an error -


i trying create database '-' in between 2 words , should work fine isn't. here log file:

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): have error in sql syntax; check manual corresponds mysql server version right syntax use near '-mohi t' @ line 1 

you can use _(underscore)

create database test1_mohit; 

or try this

  create database `test1_mohit`; 

these both work


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -