Google News
logo
OrientDB - Interview Questions
How do you create a new database in OrientDB?
Creates and connects to a new database.

Syntax :
CREATE DATABASE  [   []] [-restore=]?

* Defines the URL of the database you want to connect to. It uses the format :

* Defines the mode you want to use in connecting to the database. It can be PLOCAL or REMOTE.
* Defines the path to the database.

* Defines the user you want to connect to the database with.
* Defines the password needed to connect to the database, with the defined user.
* Defines the storage type that you want to use. You can choose between PLOCAL and MEMORY.
* Defines the database type. You can choose between GRAPH and DOCUMENT. The default is GRAPH.


Examples :

Create a local database demo :
orientdb> CREATE DATABASE PLOCAL:/usr/local/orientdb/databases/demo

Creating database [plocal:/usr/local/orientdb/databases/demo]...
Connecting to database [plocal:/usr/local/orientdb/databases/demo]...OK
Database created successfully.

Current database is: plocal:/usr/local/orientdb/databases/demo

orientdb {db=demo}>?

Create a remote database trick :


orientdb> CREATE DATABASE REMOTE:192.168.1.1/trick root
          E30DD873203AAA245952278B4306D94E423CF91D569881B7CAD7D0B6D1A20CE9 PLOCAL

Creating database [remote:192.168.1.1/trick ]...
Connecting to database [remote:192.168.1.1/trick ]...OK
Database created successfully.

Current database is: remote:192.168.1.1/trick

orientdb {db=trick}>?
Advertisement