# Local database connexion terminated unexpectedly

**URL:** <https://talk.observablehq.com/t/local-database-connexion-terminated-unexpectedly/3047>\
**Category:** Help\
**Created:** [April 9, 2020, 9:12pm UTC](https://talk.observablehq.com/t/local-database-connexion-terminated-unexpectedly/3047 "2020-04-09T21:12:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![maliky](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/maliky/32/706_2.png) [@maliky](https://talk.observablehq.com/u/maliky)\
**Post date:** [April 9, 2020, 9:12pm UTC](https://talk.observablehq.com/t/local-database-connexion-terminated-unexpectedly/3047/1 "2020-04-09T21:12:42Z")

</div>

I’m testing the database connexion from a private notebook.

I’m new to _postgrep_ but I think my db setup is ok since I can query the db locally without problem using a user account created for the occasion (`observable`) .

I installed _yarn_ and the [data-base proxy](https://github.com/observablehq/database-proxy) as suggested in [https://observablehq.com/@observablehq/self-hosted-database-proxies](https://observablehq.com/@observablehq/self-hosted-database-proxies) and executed the following two cells `client = DatabaseClient("obsdb")` and `names = client.query(``select * from courses``)` with and without the `;`.  
Those instructions are from [https://observablehq.com/@observablehq/connecting-to-databases?collection=@observablehq/introduction](https://observablehq.com/@observablehq/connecting-to-databases?collection=@observablehq/introduction)

The proxy is started but I get this error log

```auto
Error: Connection terminated unexpectedly
    at Connection.con.once (/home/observable/.config/yarn/global/node_modules/pg/lib/client.js:255:9)
    at Object.onceWrapper (events.js:277:13)
    at Connection.emit (events.js:189:13)
    at Connection.EventEmitter.emit (domain.js:441:20)
    at Socket.<anonymous> (/home/observable/.config/yarn/global/node_modules/pg/lib/connection.js:139:10)
    at Socket.emit (events.js:194:15)
    at Socket.EventEmitter.emit (domain.js:441:20)
    at endReadableNT (_stream_readable.js:1103:12)
    at process._tickCallback (internal/process/next_tick.js:63:19)

```

Look’s like a js error. Maybe the proxy ? or my parameters ? How can I know ?  
I running an up to date ubuntu 19.10

I already checked:

- my postgrep password,
- the my observable db settings.
- the postgrep url `postgresql://observable:password@127.0.0.1:2899/obsdb`
- the browser, I’m using chromium-browser… I have a doubt here…

maybe I need to open some ports localy…

---

<div class="post-metadata">

**Author:** ![javpascal](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/javpascal/32/8498_2.png) [@javpascal](https://talk.observablehq.com/u/javpascal)\
**Post date:** [May 14, 2020, 5:24am UTC](https://talk.observablehq.com/t/local-database-connexion-terminated-unexpectedly/3047/2 "2020-05-14T05:24:41Z")

</div>

Hi @maliky I am facing the same issue; did you finally get it solved?
