无法登录Neo4j服务器

时间:2015-09-19 09:18:42

标签: neo4j

在新安装的neo4j-community-2.2.4上,我收到消息"用户名或密码无效。"当使用默认用户名neo4j和密码neo4j在localhost:7474 / browser上提交登录表单时。

我确实启用了org.neo4j.server.webserver.address = 0.0.0.0和dbms.security.auth_enabled = true,服务器停止并启动浏览器shift-reload。

然后我更改了属性org.neo4j.server.webserver.address = 127.0.0.1以匹配我的/ etc / hosts并尝试使用127.0.0.1:7474/browser但是收到相同的消息。

以下是浏览器控制台输出:

Remote Address:127.0.0.1:7474
Request URL:http://localhost:7474/db/data/
Request Method:GET
Status Code:401 Unauthorized
Request Headersview source
Accept:application/json, text/plain, */*
Accept-Encoding:gzip,deflate,sdch
Accept-Language:en-US,en;q=0.8,fr;q=0.6,ru;q=0.4,es;q=0.2,sv;q=0.2,nb;q=0.2,et;q=0.2
Authorization:Basic bmVvNGo6bmVvNGo=
Cache-Control:no-cache
Connection:keep-alive
Cookie:languageCodeAdmin=en; PHPSESSID=vcbvfkvj3shajhlh5u2pue9i70; admin_template_phone_client=0; admin_template_touch_client=0; admin_template_model=1
Host:localhost:7474
If-Modified-Since:Wed, 11 Dec 2013 08:00:00 GMT
Pragma:no-cache
Referer:http://localhost:7474/browser/
User-Agent:Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/37.0.2062.120 Chrome/37.0.2062.120 Safari/537.36
X-stream:true
Response Headersview source
Content-Length:135
Content-Type:application/json; charset=UTF-8
Date:Sat, 19 Sep 2015 09:14:03 GMT
Server:Jetty(9.2.4.v20141103)
WWW-Authenticate:None
{
  "errors" : [ {
    "message" : "Invalid username or password.",
    "code" : "Neo.ClientError.Security.AuthorizationFailed"
  } ]
}

然后我尝试更改默认密码。

为此,我首先使用dbms.security.auth_enabled = false禁用身份验证,然后停止并启动服务器。

然后我尝试了以下卷曲请求:

curl -H "Accept:application/json; charset=UTF-8" -H "Content-Type: application/json" "http://localhost:7474/user/neo4j/password" -X POST -d "{ \"password\" : \"neo4j\" }" -i

但它给了我答复:

HTTP/1.1 404 Not Found
Date: Sat, 19 Sep 2015 09:25:38 GMT
Access-Control-Allow-Origin: *
Content-Length: 0
Server: Jetty(9.2.4.v20141103)

2 个答案:

答案 0 :(得分:12)

由于您的浏览器请求中出现身份验证错误,该请求使用默认凭据neo4j:neo4j,您的数据库已配置了不同的密码。要将其重置为默认值,请停止neo4j,删除data/dbms/auth并重新启动它。现在你可以使用默认的pw。

答案 1 :(得分:0)

在我的情况下,没有安装Neo4J Windows服务,只需按照以下步骤进行操作

  1. neo4j.bat install-services
  2. neo4j.bat status
  3. neo4j.bat start
  4. 它有效,欢呼

相关问题