> For the complete documentation index, see [llms.txt](https://docs.hostinger.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.hostinger.com/websites/databases.md).

# Databases

Create and manage MySQL databases in hPanel on Hostinger, including phpMyAdmin access, imports and exports, password changes, and remote connections.

MySQL databases for your websites, managed from hPanel.

## Create a database

1. Open your website dashboard.
2. Go to **Databases** → **MySQL Databases**.
3. Click **Create database**.
4. Enter a name and click **Create**.

A database user is created automatically.

## Connect from your app

| Parameter    | Value                                                                                 |
| ------------ | ------------------------------------------------------------------------------------- |
| **Host**     | `localhost` for PHP apps, `127.0.0.1` for [Node.js apps](#connect-from-a-node-js-app) |
| **Port**     | `3306`                                                                                |
| **Database** | Your database name                                                                    |
| **Username** | Your database user                                                                    |
| **Password** | Your database user's password                                                         |

Drop these in `wp-config.php` (WordPress) or `.env` (Laravel, etc.).

### Connect from a Node.js app

Set your database host to `127.0.0.1` rather than `localhost`.

PHP apps reach MySQL over a local socket, so `localhost` works for them. Node.js connects over TCP and resolves `localhost` to the IPv6 loopback address `::1`, which your database user may not be granted for — so the connection is refused:

```
Access denied for user 'u123456789_admin'@'::1'
```

`127.0.0.1` forces IPv4 and works on every account:

```
DB_HOST=127.0.0.1
DB_PORT=3306
```

Store the credentials as [environment variables](/node.js/environment-variables.md) rather than hardcoding them in your source.

> **Note:** This is a local connection — you don't need to enable [Remote MySQL](#remote-database-access) to connect from an app running on the same hosting account.

## phpMyAdmin

1. Go to **Databases** in hPanel.
2. Click **phpMyAdmin** next to the database.

Use it to browse tables, run SQL, and import/export data.

## Change a user's password

1. **Databases** → **MySQL Users**.
2. Click **Change Password** on the user.
3. Enter and confirm.

> **Warning:** Update the password in your app's config right after — or the app will stop connecting.

## Import a database

phpMyAdmin:

1. Open phpMyAdmin.
2. Select the database in the left sidebar.
3. Click **Import**.
4. Select your `.sql` file and click **Go**.

Large files via SSH:

```bash
mysql -u username -p database_name < dump.sql
```

## Export a database

1. Open phpMyAdmin.
2. Select the database.
3. Click **Export**.
4. Choose **Quick** and format **SQL**, then **Go**.

## Delete a database

> **Warning:** This is permanent. Export a backup first.

1. **Databases** → **MySQL Databases**.
2. Click **Delete** on the database.
3. Confirm.

## Remote database access

Databases are `localhost`-only by default. To allow remote connections:

1. **Databases** → **Remote MySQL**.
2. Enter the allowed IP and click **Add**.

The same page shows the **hostname** your client connects to — for example `srv1517.hstgr.io`. Remote clients use port `3306`.

***

*Last updated: August 24, 2026*
