# Account linking - Second connection not tried - error: wrong username and password

**URL:** <https://community.auth0.com/t/account-linking-second-connection-not-tried-error-wrong-username-and-password/94370>\
**Category:** Get Help\
**Tags:** custom-database-connections, connections\
**Created:** [November 14, 2022, 10:01am UTC](https://community.auth0.com/t/account-linking-second-connection-not-tried-error-wrong-username-and-password/94370 "2022-11-14T10:01:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![nahvinden](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/nahvinden/32/40399_2.png) [@nahvinden](https://community.auth0.com/u/nahvinden)\
**Post date:** [November 14, 2022, 10:01am UTC](https://community.auth0.com/t/account-linking-second-connection-not-tried-error-wrong-username-and-password/94370/1 "2022-11-14T10:01:07Z")

</div>

Hello,

The goal is to end up with one account in Auth0 with data aggregated from multiple databases.

Example:  
Two apps, same two database connections configured for both. Both connections have “Import Users to Auth0” enabled.

User logs in for the first time. Email and password matches user in the first connection. User is successfully imported to Auth0 and user is successfully authenticated.

Logging out from the application. User logs into the second app using the same email, however, using the password from the other DB. Auth0 throws bad username and password. The password is only validated based on the password used in the first login. Auth0 does not try the second connection where the password would match.

Note! In the PoC environment we only use one app, but should be the same as using two apps. If the password does not match the account imported to Auth0, it should try the second connection to trigger account linking and importing additional data from the second connection.

Thank you,  
Nils

---

<div class="post-metadata">

**Author:** ![lihua.zhang](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/lihua.zhang/32/39683_2.png) [@lihua.zhang](https://community.auth0.com/u/lihua.zhang)\
**Post date:** [November 29, 2022, 7:10pm UTC](https://community.auth0.com/t/account-linking-second-connection-not-tried-error-wrong-username-and-password/94370/4 "2022-11-29T19:10:10Z")

</div>

Hi @nahvinden ,

I understand your goal. Unfortunately if multiple databases are enabled for an application, only one will be used and the others will not be searched through to see if the user exists elsewhere or if the password is valid.

Not sure why your users are stored in two databases. If your users can be consolidated into one database, you should be able to use account linking feature without error.

Hope this helps!

---

<div class="post-metadata">

**Author:** ![lihua.zhang](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/lihua.zhang/32/39683_2.png) [@lihua.zhang](https://community.auth0.com/u/lihua.zhang)\
**Post date:** [February 2, 2023, 10:41pm UTC](https://community.auth0.com/t/account-linking-second-connection-not-tried-error-wrong-username-and-password/94370/5 "2023-02-02T22:41:48Z")

</div>


