Naming rules for databases

Database names are subject to the standard Cypher restrictions on valid identifiers. See Cypher Manual → Naming rules and recommendations.

Naming rules for databases are as follows:

  • Length must be between 3 and 63 characters.

  • The first character of a name must be an ASCII alphabetic character.

  • Subsequent characters must be ASCII alphabetic or numeric characters, dots or dashes; [a..z][0..9].-.

  • Names cannot end with dots or dashes.

  • Names are case-insensitive and normalized to lowercase.

  • Names that begin with an underscore and with the prefix system are reserved for internal use.

The - (dash) and . (dot) characters are not legal in Cypher variables. Names with a - in them must be enclosed within backticks. For example, CREATE DATABASE `main-db` is a valid database name. Database names are the only identifier for which dots do not need to be escaped. For example main.db is a valid database name. However, this behavior is deprecated due to the difficulty of determining if a dot is part of the database name or a delimiter for a database alias in a composite database.

It is possible to create an alias to refer to an existing database to avoid these restrictions. For more information, see Creating database aliases.