# Can't connect to localhost mysql using custom database

**URL:** <https://community.auth0.com/t/cant-connect-to-localhost-mysql-using-custom-database/63992>\
**Category:** Get Help\
**Created:** [June 7, 2021, 8:12am UTC](https://community.auth0.com/t/cant-connect-to-localhost-mysql-using-custom-database/63992 "2021-06-07T08:12:54Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![manhhoang3151996](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/manhhoang3151996/32/29811_2.png) [@manhhoang3151996](https://community.auth0.com/u/manhhoang3151996)\
**Post date:** [June 7, 2021, 8:12am UTC](https://community.auth0.com/t/cant-connect-to-localhost-mysql-using-custom-database/63992/1 "2021-06-07T08:12:54Z")

</div>

I am using custom database to connect with my localhost database and get **ETIMEDOUT** error . I read about it must be public address and allow inbound connections from some IPs.

I used mysql-workbench to connect to public ip, and everything works fine.  
This is my login script

 ![image](https://global.discourse-cdn.com/auth0/original/3X/2/b/2bf0912a8cb869ffa70d44face338d8a615e2241.png)

And this is my ip allow list:  
 ![image](https://global.discourse-cdn.com/auth0/original/3X/3/3/3354ead8916c3d05549a3c2908aa404bcb241b37.png)

I really don’t understand clearly about **allow inbound connections** part. So i think i did something wrong at that step. Can any one please help me? Thank you very much

---

<div class="post-metadata">

**Author:** ![manhhoang3151996](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/manhhoang3151996/32/29811_2.png) [@manhhoang3151996](https://community.auth0.com/u/manhhoang3151996)\
**Post date:** [June 7, 2021, 10:26am UTC](https://community.auth0.com/t/cant-connect-to-localhost-mysql-using-custom-database/63992/2 "2021-06-07T10:26:38Z")

</div>

And i have 1 more question. I want to use auth0 DB to store some sensitive data like email and password. Other information i will store at my external DB, and i will create field auth0\_id to get data in auth0. Is it possible to use 2 DB at the same time?

---

<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:** [June 7, 2021, 1:20pm UTC](https://community.auth0.com/t/cant-connect-to-localhost-mysql-using-custom-database/63992/3 "2021-06-07T13:20:58Z")

</div>

Hi @manhhoang3151996

The Custom DB script runs on a server inside of Auth0. It cannot access a localhost address on your computer.

You must use a non-localhost non-VPN address for your DB.

For your second question: the answer is yes. Normally with Auth0, Auth0 stores the Identy data such as username and password, and your applications stores all other data about the user. The two databases are linked via a user ID (either Auth0’s user ID or yours)

John

---

<div class="post-metadata">

**Author:** ![manhhoang3151996](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/manhhoang3151996/32/29811_2.png) [@manhhoang3151996](https://community.auth0.com/u/manhhoang3151996)\
**Post date:** [June 7, 2021, 2:20pm UTC](https://community.auth0.com/t/cant-connect-to-localhost-mysql-using-custom-database/63992/4 "2021-06-07T14:20:39Z")

</div>

@john.gateley thank you for helping me 😀  
For my second question, so i think i don’t need to connect with an external DB, i just get user information after they login then query in my DB to get other information 😃. But if i don’t use custom DB, is it possible for me to create user in Auth0 DB via API?

---

<div class="post-metadata">

**Author:** ![nick.gieschen](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/nick.gieschen/32/13374_2.png) [@nick.gieschen](https://community.auth0.com/u/nick.gieschen)\
**Post date:** [June 7, 2021, 8:19pm UTC](https://community.auth0.com/t/cant-connect-to-localhost-mysql-using-custom-database/63992/5 "2021-06-07T20:19:56Z")

</div>

I use ngrok for this type of scenario.

---

<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:** [June 8, 2021, 1:29pm UTC](https://community.auth0.com/t/cant-connect-to-localhost-mysql-using-custom-database/63992/6 "2021-06-08T13:29:33Z")

</div>

Hi @manhhoang3151996

Yes, you can create a user via the management API in Auth0.

John

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [June 23, 2021, 1:30pm UTC](https://community.auth0.com/t/cant-connect-to-localhost-mysql-using-custom-database/63992/7 "2021-06-23T13:30:31Z")

</div>

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.
