views:

74

answers:

2

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 wrong?

+4  A: 

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

CREATE DATABASE `1`;

Limitations on names are in the MySQL documentation.

martin clayton
A: 

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...

Ondra Žižka