# Connecting to local database via Python Bolt

**URL:** <https://community.neo4j.com/t/connecting-to-local-database-via-python-bolt/11557>\
**Category:** Python\
**Created:** [November 3, 2019, 6:16am UTC](https://community.neo4j.com/t/connecting-to-local-database-via-python-bolt/11557 "2019-11-03T06:16:59Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Guy.garrett](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/guy.garrett/32/7229_2.png) [@Guy.garrett](https://community.neo4j.com/u/Guy.garrett)\
**Post date:** [November 3, 2019, 6:16am UTC](https://community.neo4j.com/t/connecting-to-local-database-via-python-bolt/11557/1 "2019-11-03T06:16:59Z")

</div>

Hello,

I am new to Neo4J - and I'm struggling to connect to the sandbox via python.  
I've tried the following code:  
uri="bolt://localhost:7687"  
driver = GraphDatabase.driver(uri, auth=("neo4j", "my\_password"))

but get the following error:  
neobolt.exceptions.AuthError: The client is unauthorized due to authentication failure.  
Failed to write data to connection Address(host='localhost', port=7687) (Address(host='127.0.0.1', port=7687)); ("0; 'Underlying socket connection gone (\_ssl.c:1997)'")

Any ideas?

Many thanks.  
Guy

---

<div class="post-metadata">

**Author:** ![mark.needham](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/mark.needham/32/104_2.png) [@mark.needham](https://community.neo4j.com/u/mark.needham)\
**Post date:** [November 4, 2019, 1:08pm UTC](https://community.neo4j.com/t/connecting-to-local-database-via-python-bolt/11557/2 "2019-11-04T13:08:56Z")

</div>

Hi,

Could you clarify what you mean when you say you're trying to connect to the sandbox? Do you mean a Neo4j Sandbox from [Neo4j Sandbox | Online Graph Database – No Download Required](https://neo4j.com/sandbox-v2/)?

If so then I think your `uri` is incorrect - the sandbox should tell you the value to use for that:

 ![image](https://us1.discourse-cdn.com/flex021/uploads/neo4jcommunity/original/2X/2/22e95d84fee37b7453269b02099c44a6abf6ee80.png)

e.g. the URI for my database here would be:

`54.162.226.29:37080`

If you're trying to connect to a local Neo4j database then I'm not sure what the problem could be other than that the password is incorrect.

---

<div class="post-metadata">

**Author:** ![Guy.garrett](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/guy.garrett/32/7229_2.png) [@Guy.garrett](https://community.neo4j.com/u/Guy.garrett)\
**Post date:** [November 5, 2019, 8:39am UTC](https://community.neo4j.com/t/connecting-to-local-database-via-python-bolt/11557/3 "2019-11-05T08:39:55Z")

</div>

Thanks Mark,  
I’m trying to connect to local desktop version but also tried the neo4jsandbox.

For each instances it looks like the user is neo4j but I have no record of the password associated with that user. I’ve tried neo4j as the password and that doesn’t work either.

There also doesn’t seem to be a way to reset the password without knowing the current one...so I’m a bit stuck...

---

<div class="post-metadata">

**Author:** ![mark.needham](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/mark.needham/32/104_2.png) [@mark.needham](https://community.neo4j.com/u/mark.needham)\
**Post date:** [November 25, 2019, 2:20pm UTC](https://community.neo4j.com/t/connecting-to-local-database-via-python-bolt/11557/4 "2019-11-25T14:20:35Z")

</div>

If you're using Neo4j Desktop you can reset the password via the Administration tab:

![Selection_902](https://us1.discourse-cdn.com/flex021/uploads/neo4jcommunity/original/2X/7/70a190c105f8e98fd0f0f7157f0a6dcfd04154b6.png)
