5.2. Administration and configuration

This section describes how to manage multiple active databases.

This section describes the following:

5.2.1. Administrative commands

For detailed information on Cypher administrative commands, see Cypher Manual → Administration.

The following Cypher commands are used on the system database to manage multiple databases:

Command Description

CREATE DATABASE name [1]

Create and start a new database.

DROP DATABASE name [1]

Drop (remove) an existing database.

START DATABASE name

Start a database that has been stopped.

STOP DATABASE name

Shut down a database.

SHOW DATABASE name

Show the status of a specific database.

SHOW DATABASES

Show the name and status of all the databases.

SHOW DEFAULT DATABASE

Show the name and status of the default database.

[1]Enterprise Edition only.

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 are case-insensitive and normalized to lowercase.
  • Names that begin with an underscore and with the prefix system are reserved for internal use.

All of the above commands are executed as Cypher commands, and the database name is subject to the standard Cypher restrictions on valid identifiers. In particular, the - (dash) and . (dot) characters are not legal in Cypher variables, and therefore names with dashes and dots need to be escaped by enclosing with back-ticks. For example, CREATE DATABASE `main.db`.

For detailed information on Cypher administrative commands, see Cypher Manual → Administration.

For examples of using the Cypher administrative commands to manage multiple active databases, see Section 5.3, “Queries”.

5.2.2. Configuration parameters

Configuration parameters are defined in the neo4j.conf file.

The following configuration parameters are applicable for managing databases:

Parameter name Description Default value

dbms.default_database

Name of the default database for the Neo4j instance. The database is created if it does not exist when the instance starts.

neo4j

dbms.max_databases [1]

Maximum number of databases that can be used in a Neo4j single instance or Causal Cluster. The number includes all the online and offline databases. The value is an integer with a minimum value of 2.

Note that once the limit has been reached, it is not possible to create any additional databases. Similarly, if the limit is changed to a number lower than the total number of existing databases, no additional databases can be created.

100

[1]Enterprise Edition only.