> For the complete documentation index, see [llms.txt](https://fusionauth.io/docs/llms.txt)

# Install a Database | FusionAuth Docs

Learn how to install the database that FusionAuth will use to store user data.

# Install a Database

[Edit on GitHub](https://github.com/FusionAuth/fusionauth-site/blob/main/astro/src/content/docs/get-started/download-and-install/database.mdx)

[View Markdown](https://fusionauth.io/docs/get-started/download-and-install/database.md)

FusionAuth requires a database that meets the [System Requirements](https://fusionauth.io/docs/get-started/download-and-install/reference/system-requirements.md). This page explains how to install a supported database.

## Install PostgreSQL

### Manual Install

To install PostgreSQL, follow the installation instructions for your platform at [postgresql.org](https://www.postgresql.org/download/). We recommend PostgreSQL 15 or newer.

### Homebrew

If you don't have PostgreSQL installed, you can install it using Homebrew:

1.  Install PostgreSQL:
    
    ```shell-session
    $ brew install postgresql@16
    ```
    
2.  Start PostgreSQL with Homebrew services:
    
    ```shell-session
    $ brew services start postgresql@16
    ```
    
3.  Add the following line to your `~/.zshrc` or `~/.bashrc` file to add PostgreSQL binaries to your `PATH`:
    
    ```shell-session
    $ export PATH="$PATH:$(brew --prefix postgresql@16)/bin"
    ```
    

Then, configure PostgreSQL for use with FusionAuth:

1.  Create the FusionAuth user, `fusionauth`, with password `fusionauth`:
    
    ```shell-session
    $ psql --command="CREATE USER fusionauth PASSWORD 'fusionauth'" --command="\du" postgres
    ```
    
2.  Create a database named `fusionauth` owned by the `fusionauth` user:
    
    ```shell-session
    $ createdb --owner=fusionauth fusionauth
    ```
    

## Install MySQL

To install MySQL, follow the installation instructions for your platform at [dev.mysql.com](https://dev.mysql.com/downloads/installer/).

FusionAuth requires the ability to store 4-byte unicode. To store 4-byte unicode, you must configure your MySQL server to use the `utf8mb4` character set. If you don't configure this character set, FusionAuth will fail to start and log an error.

To configure your MySQL instance to use `utf8mb4`, add the following lines to `my.cnf` (`my.ini` on Windows):

```ini
[client]
default-character-set = utf8mb4

[mysql]
default-character-set = utf8mb4

[mysqld]
character-set-client-handshake = FALSE
character-set-server = utf8mb4
collation-server = utf8mb4_bin
```

After modifying the configuration file, restart MySQL to load your changes.

This configuration changes the character set for the entire MySQL server. If you share your MySQL server across multiple databases and applications, check to ensure that this change doesn't impact functionality.

Once you have configured the available options, if startup still fails due to this validation, you may disable this feature. See `database.mysql.enforce-utf8mb4` in the [Configuration reference](https://fusionauth.io/docs/reference/configuration.md).

### Install MySQL Connector

To use MySQL with FusionAuth, you also need the MySQL Connector for Java. This is a manual process due to the way that Oracle licenses MySQL. To get the MySQL Connector into the correct location for FusionAuth:

1.  Download the MySQL Connector version 8.0.23 or newer using the Platform Independent installer from [Oracle](https://dev.mysql.com/downloads/connector/j/8.0.html).
2.  Unzip or untar the archive.
3.  The archive should contain a file named `mysql-connector-java-<version>.jar`. Copy this file to the FusionAuth app library directory, located in the installation directory at `fusionauth-app/lib`. For example, a DEB package install on a Debian Linux system would locate the installation directory at `/usr/local/fusionauth/fusionauth-app/lib`.