Casper-RS avatar
Made by Casper-RS

Database Setup

This page will guide you through setting up a MySQL database user for Pterodactyl.
Follow each step carefully in the given order.

0

Panel preparation

Before we touch the VPS terminal, lets make sure the panel is ready.

  • ➥ First login to your Pterodactyl panel with an admin account.
  • ➥ Then navigate to the admin settings (gears icon on the right top)
  • ➥ On the left navigation menu in the admin settings, click on databases.
  • ➥ Click on "Create New"
1

Login as root

After you logged in on your pterodactyl panel, we are heading to the VPS terminal again.
Open your preferred SSH client (for example Termius or PuTTY) and connect to your VPS.

Then login as root again:

su root

Enter your root password and press enter.

2

Open the MySQL shell

Once logged in as root, open the MySQL prompt.

mysql

Then press enter.
3

Create a database user

Create a new database user that Pterodactyl will use.

CREATE USER 'yourDatabaseUsername'@'yourVPSIpAddress' IDENTIFIED BY 'YourPassword';
Important!
When doing MySQL commands it is important to type a ; after every command and then press enter.
Not doing so will result in an -> appearing in your terminal.
If that happens make sure to type a ; anyway and hit enter.
Replace the credentials with your own!
Important
Make sure to replace the following with your own credentials!

  • yourDatabaseUsername ➤ Pick a username for your database.
  • yourVPSIpAddress ➤ Your VPS IP-address.
  • YourPassword ➤ A strong password, make sure its letters and numbers only!
4

Grant permissions

Grant full permissions to the newly created user.

GRANT ALL PRIVILEGES ON *.* TO 'yourDatabaseUsername'@'yourVPSIpAddress' WITH GRANT OPTION;
5

Apply permission changes

Apply all permission changes by flushing privileges.

FLUSH PRIVILEGES;
6

Configure the database in the panel

Return to your Pterodactyl panel and fill in the database form:

  • Name:
    Any name

  • Host:
    Your VPS IP

  • Username:
    The username you just created in step 3

  • Password:
    The password for the user you just created in step 3

  • Port:
    3306 (default)

  • Linked Node:
    select your created node

If you have a DNS-only (grey cloud) A-record, you may use it instead of the numeric IP.
Example: node.yourdomain.com

Congratulations!

You successfully connected a database to the panel!
You can now start allocation databases for each server and create them!