For the complete documentation index, see llms.txt. This page is also available as Markdown.

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 DatabasesMySQL 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

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:

127.0.0.1 forces IPv4 and works on every account:

Store the credentials as environment variables rather than hardcoding them in your source.

Note: This is a local connection — you don't need to enable Remote MySQL 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. DatabasesMySQL 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:

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. DatabasesMySQL Databases.

  2. Click Delete on the database.

  3. Confirm.

Remote database access

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

  1. DatabasesRemote 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

Last updated

Was this helpful?