OrientDB基本使用

 官网下载orientdb-3.1.10.zip,解压E:\Programs\orientdb-3.1.10\bin,启动服务器server.bat

其他安装方式参考https://orientdb.com/docs/last/admin/installation/

服务端:

orientdb-server-config.xml 配置端口,默认如下两个端口

第一次提示输入root账号密码输入后保存到orientdb-server-config.xml的user节点。后续创建数据库、列数据库都需要用root账号和此密码。如果账号密码输入错误connet并没有报错,都是提示OK,

后面进行查询数据库时候就会报错权限不足。

使用console.bat控制台命令来连接数据库

Type 'help' to display all the supported commands.
orientdb> CONNECT remote:localhost root su*****12
OK
orientdb {server=remote:localhost}> list databases

Found 1 databases:

* demodb
orientdb {server=remote:localhost/test}> CREATE DATABASE remote:localhost/test admin admin

Creating database [remote:localhost/test] using the storage type [PLOCAL]...
Error: com.orientechnologies.orient.core.exception.OSecurityAccessException: Wrong user/password to [connect] to the remote OrientDB Server instance

orientdb {server=remote:localhost/test}> CREATE DATABASE remote:localhost/test root suo****12

Creating database [remote:localhost/test] using the storage type [PLOCAL]...
Database created successfully.

Current database is: remote:localhost/test
orientdb {db=test}>

也可以通过图形化进行访问,这里默认数据库demodb的用户和密码是admin、admin。可以登录后security的tab页进行admin账号密码修改。

创建数据库的账户密码也不能随便输,而是用root账号来创建。test数据库创建后也是有默认如下用户(密码和用户名相同),用如下用户就可以登录test数据库。

直接连接某个数据库 

orientdb {db=test}> CONNECT remote:localhost/demodb admin admin

Disconnecting from the database [test]...OK
IMPORTANT! Using default password is unsafe, please change password for user 'admin' on database 'demodb'
Connecting to database [remote:localhost/demodb] with user 'admin'...OK
orientdb {db=demodb}>

如果在服务器可以使用本地方式连接,效率更高

orientdb> connect plocal:E:/Programs/orientdb-3.1.10/databases/test admin admin
IMPORTANT! Using default password is unsafe, please change password for user 'admin' on database 'test'
Connecting to database [plocal:E:/Programs/orientdb-3.1.10/databases/test] with user 'admin'...
2021-04-13 16:54:12:121 WARNI IMPORTANT! Using default password is unsafe, please change password for user 'admin' on database 'test' [OrientDBEmbedded]
2021-04-13 16:54:12:567 WARNI Storage 'test' was not closed properly. Will try to recover from write ahead log [OLocalPaginatedStorage]
2021-04-13 16:54:17:757 WARNI Record com.orientechnologies.orient.core.storage.impl.local.paginated.wal.common.EmptyWALRecord{lsn_operation_id=OperationIdLSN{operationId=471, lsn=OLogSequenceNumber{segment=7, position=22}}} will be skipped during data restore [OLocalPaginatedStorage]OK
orientdb {db=test}>

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值