Skip to content

Database Setup

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

Step-by-step guide7 steps
  1. Step 0

    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”
  2. Step 1

    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:

    Terminal window
    su root

    Enter your root password and press enter.

  3. Step 2

    Once logged in as root, open the MySQL prompt.

    Terminal window
    mysql

    Then press enter.

  4. Step 3

    Create a new database user that Pterodactyl will use.

    CREATE USER 'yourDatabaseUsername'@'yourVPSIpAddress' IDENTIFIED BY 'YourPassword';
    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!
  5. Step 4

    Grant full permissions to the newly created user.

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

    Apply all permission changes by flushing privileges.

    FLUSH PRIVILEGES;
  7. Step 6

    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
Congratulations!

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