我从 orientdb 控制台创建了一个数据库:
create database plocal:/C:/Development/orientdb/databases/testdb root root plocal graph
我启动了服务器以确保我的数据库已成功创建。我打开网页界面:
localhost:2480
我使用root
用户和root
密码登录到 testdb。一切正常。但是当我现在想从 Java 代码连接到我的数据库时:
OrientGraph graph = null;
try {
graph = new OrientGraph("plocal:C:/Development/orientdb/databases/testdb", "root", "root");
System.out.println("success");
} catch(OException e) {
System.out.println("no success - " + e.getMessage());
e.printStackTrace();
} finally {
if(graph != null) {
graph.shutdown();
}
}
我得到以下异常:
Exception in thread "main" com.orientechnologies.orient.core.exception.OSecurityAccessException: User or password not valid for database: 'testdb'
at com.orientechnologies.orient.core.metadata.security.OSecurityShared.authenticate(OSecurityShared.java:150)
at com.orientechnologies.orient.core.metadata.security.OSecurityProxy.authenticate(OSecurityProxy.java:83)
at com.orientechnologies.orient.core.db.record.ODatabaseRecordAbstract.open(ODatabaseRecordAbstract.java:128)
at com.orientechnologies.orient.core.db.ODatabaseWrapperAbstract.open(ODatabaseWrapperAbstract.java:49)
at com.orientechnologies.orient.core.db.graph.OGraphDatabase.open(OGraphDatabase.java:92)
at de.hof.iisys.relationExtraction.freebase.tinkerpop.DAO.openGraph(DAO.java:30)
at de.hof.iisys.relationExtraction.freebase.main.Main.main(Main.java:44)
为什么他告诉我用户名或密码是错误的而不是错误的?