Start and stop databases
Neo4j supports the management of multiple databases within the same DBMS.
The metadata for these databases, including the associated security model, is maintained in a special database called the system
database.
All multi-database administrative commands must be run against the system
database.
These administrative commands are automatically routed to the system
database when connected to the DBMS over Bolt.
Start databases
Databases can be started using the command START DATABASE
.
Both standard databases and composite databases can be started using this command. |
Start a database
Starting a database is a straightforward operation.
Suppose you have a database named customers
.
To start it, use the following command:
START DATABASE customers
You can see the status of the started database by running the command SHOW DATABASE name
.
SHOW DATABASE customers YIELD name, requestedStatus, currentStatus
+-----------------------------------------------+ | name | requestedStatus | currentStatus | +-----------------------------------------------+ | "customers" | "online" | "online" | +-----------------------------------------------+
Start a database with WAIT
You can start your database using WAIT
sub-clause to ensure that the command waits for a specified amount of time until the database is started.
START DATABASE customers WAIT 5 SECONDS
Stop databases
Databases can be stopped using the command STOP DATABASE
.
Stop a database
To stop a database, use the following command:
STOP DATABASE customers
Both standard databases and composite databases can be stopped using this command. |
The status of the stopped database can be seen using the command SHOW DATABASE name
:
SHOW DATABASE customers YIELD name, requestedStatus, currentStatus
+-----------------------------------------------+ | name | requestedStatus | currentStatus | +-----------------------------------------------+ | "customers" | "offline" | "offline" | +-----------------------------------------------+
Stop a database with WAIT
You can also stop your database using the WAIT
sub-clause, which allows you to specify the amount of time that the system should wait for the database to stop.
STOP DATABASE customers WAIT 10 SECONDS
Databases that are stopped with the |