# Custom database connection not working

**URL:** <https://community.auth0.com/t/custom-database-connection-not-working/24347>\
**Category:** Get Help\
**Tags:** user-migration, custom-database\
**Created:** [April 24, 2019, 6:38am UTC](https://community.auth0.com/t/custom-database-connection-not-working/24347 "2019-04-24T06:38:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![team\_padmorecity](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/team_padmorecity/32/10784_2.png) [@team\_padmorecity](https://community.auth0.com/u/team_padmorecity)\
**Post date:** [April 24, 2019, 6:38am UTC](https://community.auth0.com/t/custom-database-connection-not-working/24347/1 "2019-04-24T06:38:05Z")

</div>

Hi Team,

We are experiencing a weird behavior when migrate the users with custom database. We have created the Staging db connection, that connects to our postgresql database url.

 ![Selection_421](https://global.discourse-cdn.com/auth0/original/2X/9/9cc286a5c7a54317fc72d54be9230eae7a7af12c.png)

When we selected `Try` for Login and Get User script, they are both working

 ![Selection_423](https://global.discourse-cdn.com/auth0/original/2X/c/c7943a1ccc352599d66a7ee1359959de923b261b.png) ![Selection_422](https://global.discourse-cdn.com/auth0/original/2X/5/5c83fee0e188f8502356324a292a5b549c7233fb.png)

However, when we select `Try Connection` and enter the exact same email/password, it pops out the `Wrong email and password` error.

To add to this, we have 2 Database connection, one for production and one for staging that only differs in database\_url configuration. The one on production worked fine. Will it affect staging connection?

Any idea why this happened?

---

<div class="post-metadata">

**Author:** ![team\_padmorecity](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/team_padmorecity/32/10784_2.png) [@team\_padmorecity](https://community.auth0.com/u/team_padmorecity)\
**Post date:** [April 24, 2019, 6:52am UTC](https://community.auth0.com/t/custom-database-connection-not-working/24347/2 "2019-04-24T06:52:09Z")

</div>

It’s confusing, we have setup a new user to test and it worked for that new user, but still failing for that previous user. We didn’t change anything to the code.

---

<div class="post-metadata">

**Author:** ![john.gateley](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/john.gateley/32/10879_2.png) [@john.gateley](https://community.auth0.com/u/john.gateley)\
**Post date:** [April 24, 2019, 2:06pm UTC](https://community.auth0.com/t/custom-database-connection-not-working/24347/3 "2019-04-24T14:06:23Z")

</div>

Do you have any information in the tenant logs?

John

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [September 2, 2019, 12:50pm UTC](https://community.auth0.com/t/custom-database-connection-not-working/24347/4 "2019-09-02T12:50:24Z")

</div>


