开发者

mysql numeric database limitation

开发者 https://www.devze.com 2022-12-18 01:26 出处:网络
is there a limitation of database name can\'t be created as numeric? mysql> CREATE DATABASE 1; ...results in:

is there a limitation of database name can't be created as numeric?

mysql> CREATE DATABASE 1;

...results in:

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 '1' at line 1

....or am I doing something开发者_Go百科 wrong?


You can create databases with purely numeric names - you need to quote though:

CREATE DATABASE `1`;

Limitations on names are in the MySQL documentation.


There's the backticks option whatever name, but it's a very bad practice to use non-standard names, and even worse practice to use databases as a kind of record. Think of migrating, various automated tools, gui editors...

0

精彩评论

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