开发者

Can a database name start with a number?

开发者 https://www.devze.com 2023-03-06 01:58 出处:网络
I\'m wondering if a database name can start with a number e.g 143doors. I found some answer here http://markmail.org/message/yw57rt3tweldtxet but I\'m not quite sure since it\'s 1999.

I'm wondering if a database name can start with a number e.g 143doors.

I found some answer here http://markmail.org/message/yw57rt3tweldtxet but I'm not quite sure since it's 1999.

Will th开发者_StackOverflow社区ere be disadvantages if I start with a number?


Within MySQL Workbench, you are going to have trouble querying if you do something like {db_name}.{table} and your db_name starts with a number.

The solution to this is the backtick mentioned in the accepted answer. An example is like:

select * from `2013e93`.blurb

where the db_name is 2013e93 and the table is blurb.


A quick test says, yes you can. Using spaces in database names will lead to trouble, though. You'll have to use `143 doors` (with the backtick) if you really want to do this.

0

精彩评论

暂无评论...
验证码 换一张
取 消