首页 > 解决方案 > 由于身份验证失败,客户端未经授权

问题描述

嗨,我正在尝试通过 python 调用图表,但出现此错误

作者:由于认证失败,客户端未授权。

这是我的代码:

import csv
from py2neo import Graph, Node

N_MOVIES = 1000
N_RATINGS = 1000
N_TAGS = 1000
N_LINKS = 1000
USERNAME = "arooj"
PASS = "abcd" #default

graph = Graph("bolt://localhost:7687", auth = (USERNAME, PASS))

def main():
    createGenreNodes()

    print("Step 1 out of 4: loading movie nodes")
    loadMovies()

    print("Step 2 out of 4: loading rating relationships")
    loadRatings()

    print("Step 3 out of 4: loading tag relationships")
    loadTags()

    print("Step 4 out of 4: updating links to movie nodes")
    loadLinks()

标签: pythonauthenticationneo4jcyphergraph-databases

解决方案


首次登录时,我们必须设置密码。

执行以下操作:

  1. docker exec -it name_of_docker bash

  2. 密码壳 -u neo4j -p neo4

这将要求输入新密码。更改密码后,在您的代码中传递新密码。


推荐阅读