cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

[Py2neo] AuthError when accessing graph from Python

tw2567
Node Link

Hi! I'm a newbie to Neo4j and I got problems when trying to connect to the neo4j browser using Python.

I just tried out some simple codes that can be found in most of the Py2neo tutorials out there: (in jupyter notebook)

from py2neo import Graph
from neo4j import GraphDatabase
g = Graph(uri="bolt://localhost:7687", auth=("neo4j", "neo4j"))

Object g:

<Graph database=<Database uri='bolt://localhost:7687' secure=False user_agent='py2neo/4.3.0 neobolt/1.7.13 Python/3.7.1-final-0 (darwin)'> name='data'>

However, when I tried to do some actual work like

tx = graph.begin()

I got the error:

AuthError: The client is unauthorized due to authentication failure.

more details:

~/anaconda3/lib/python3.7/site-packages/neobolt/direct.py in on_failure(self, metadata)
    776         message = metadata.get("message", "Connection initialisation failed")
    777         if code == "Neo.ClientError.Security.Unauthorized":
--> 778             raise AuthError(message)
    779         else:
    780             raise ServiceUnavailable(message)type or paste code here

I'm using Neo4j community 3.5.7 (I've installed Neo4j Desktop before but I deleted). Can anyone help me out? Thanks!

-- Tianyi

1 ACCEPTED SOLUTION

First access to a started database uses the credentials neo4j/neo4j, but you must change the password for the neo4j user. Did you change the password?

Elaine

View solution in original post

2 REPLIES 2

First access to a started database uses the credentials neo4j/neo4j, but you must change the password for the neo4j user. Did you change the password?

Elaine

Thank you very much Elaine. It worked!

-- Tianyi