> ## Documentation Index
> Fetch the complete documentation index at: https://docs-dev-fix-docs-5546-update-db-search.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Auth0 Database Connections

> Learn how to create and use a database connection using either the Auth0 user store or your own user store.

Auth0 provides database connections to authenticate users with an identifier (email, username, or phone number) and password or [passkeys](/docs/authenticate/database-connections/passkeys/configure-passkey-policy). These credentials are securely stored in the Auth0 user store or in your own database.

You can create a new database connection and manage existing ones at [Auth0 Dashboard > Authentication > Database](https://manage.auth0.com/#/connections/database).

## Database options

### Use Auth0 user store

Auth0 provides the database infrastructure to store your users by default. This scenario provides the best performance for the authentication process since all data is stored in Auth0.

The Auth0-hosted database is highly secure. Passwords are never stored or logged in plain text but are hashed with **bcrypt**. Varying levels of password security requirements can also be enforced. To learn more, read [Password Strength in Auth0 Database Connections](/docs/authenticate/database-connections/password-strength).

<Callout icon="file-lines" color="#0EA5E9" iconType="regular">
  For database connections, Auth0 limits the number of repeat login attempts per user and IP address. To learn more, read [Database login limits](/docs/troubleshoot/customer-support/operational-policies/rate-limit-policy#database-login-limits).
</Callout>

To use Auth0's database infrastructure as your user store, you have options to migrate your users to Auth0. The [automatic migration](/docs/manage-users/user-migration/configure-automatic-migration-from-your-database) feature adds your users to the Auth0 database one-at-a-time as each logs in and avoids asking your users to reset their passwords all at the same time. Or, use Management API to create a job to [import users](/docs/manage-users/user-migration/bulk-user-imports). To learn more, read [User Migration Scenarios](/docs/manage-users/user-migration/user-migration-scenarios) for migration examples.

### Use your own database

If you have an existing user store, or wish to store user credentials on your own server, Auth0 enables you to connect to a [custom database](/docs/authenticate/database-connections/custom-db) or repository and use it as the identity provider.

<Frame>
  <img src="https://mintcdn.com/docs-dev-fix-docs-5546-update-db-search/NmLl6Pmp2OlcD5Hd/docs/images/cdy7uua7fh8z/3SNKwx0KzkUwbodqUQbtvW/df720f8871b56dd7ec399a24aa621c36/Authentication%3EDatabase%3Euse-my-own-database.png?fit=max&auto=format&n=NmLl6Pmp2OlcD5Hd&q=85&s=af54594ef3bb68aa12d866cf7a39cb9a" alt="" width="650" height="469" data-path="docs/images/cdy7uua7fh8z/3SNKwx0KzkUwbodqUQbtvW/df720f8871b56dd7ec399a24aa621c36/Authentication>Database>use-my-own-database.png" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/docs-dev-fix-docs-5546-update-db-search/NmLl6Pmp2OlcD5Hd/docs/images/cdy7uua7fh8z/3SNKwx0KzkUwbodqUQbtvW/df720f8871b56dd7ec399a24aa621c36/Authentication%3EDatabase%3Euse-my-own-database.png?w=280&fit=max&auto=format&n=NmLl6Pmp2OlcD5Hd&q=85&s=1e12da804c45714622f252499e7734e7 280w, https://mintcdn.com/docs-dev-fix-docs-5546-update-db-search/NmLl6Pmp2OlcD5Hd/docs/images/cdy7uua7fh8z/3SNKwx0KzkUwbodqUQbtvW/df720f8871b56dd7ec399a24aa621c36/Authentication%3EDatabase%3Euse-my-own-database.png?w=560&fit=max&auto=format&n=NmLl6Pmp2OlcD5Hd&q=85&s=3ede51fde722f26e63bf21d2a8c1024e 560w, https://mintcdn.com/docs-dev-fix-docs-5546-update-db-search/NmLl6Pmp2OlcD5Hd/docs/images/cdy7uua7fh8z/3SNKwx0KzkUwbodqUQbtvW/df720f8871b56dd7ec399a24aa621c36/Authentication%3EDatabase%3Euse-my-own-database.png?w=840&fit=max&auto=format&n=NmLl6Pmp2OlcD5Hd&q=85&s=b4d32d706e42d14d9663640473dcefda 840w, https://mintcdn.com/docs-dev-fix-docs-5546-update-db-search/NmLl6Pmp2OlcD5Hd/docs/images/cdy7uua7fh8z/3SNKwx0KzkUwbodqUQbtvW/df720f8871b56dd7ec399a24aa621c36/Authentication%3EDatabase%3Euse-my-own-database.png?w=1100&fit=max&auto=format&n=NmLl6Pmp2OlcD5Hd&q=85&s=8fa3c547b5f3a63d3acbcaf5f77899ce 1100w, https://mintcdn.com/docs-dev-fix-docs-5546-update-db-search/NmLl6Pmp2OlcD5Hd/docs/images/cdy7uua7fh8z/3SNKwx0KzkUwbodqUQbtvW/df720f8871b56dd7ec399a24aa621c36/Authentication%3EDatabase%3Euse-my-own-database.png?w=1650&fit=max&auto=format&n=NmLl6Pmp2OlcD5Hd&q=85&s=9352a4eaff10585b08e9f44699d31c0c 1650w, https://mintcdn.com/docs-dev-fix-docs-5546-update-db-search/NmLl6Pmp2OlcD5Hd/docs/images/cdy7uua7fh8z/3SNKwx0KzkUwbodqUQbtvW/df720f8871b56dd7ec399a24aa621c36/Authentication%3EDatabase%3Euse-my-own-database.png?w=2500&fit=max&auto=format&n=NmLl6Pmp2OlcD5Hd&q=85&s=a81d8ef8d8af0ea999c71bc7ef93432a 2500w" />
</Frame>

In this scenario, you provide the login script to authenticate the user that will execute each time a user attempts to log in. Optionally, you can [create scripts](/docs/authenticate/database-connections/custom-db/templates) for sign-up, email verification, password reset, and delete user functionality.

The scripts are Node.js code. Auth0 provides [templates](/docs/authenticate/database-connections/custom-db/templates) for most common databases, such as ASP.NET Membership Provider, MongoDB, MySQL, PostgreSQL, SQL Server, Windows Azure SQL Database, and for a web service accessed by Basic Auth. Essentially, you can connect to almost any kind of database or web service with a custom script.
