Database Setup
This page will guide you through setting up a MySQL database user for Pterodactyl.
Follow each step carefully in the given order.
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"
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.
Open the MySQL shell
Once logged in as root, open the MySQL prompt.
mysqlThen press enter.
Create a database user
Create a new database user that Pterodactyl will use.
CREATE USER 'yourDatabaseUsername'@'yourVPSIpAddress' IDENTIFIED BY 'YourPassword';
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.
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!
Grant permissions
Grant full permissions to the newly created user.
GRANT ALL PRIVILEGES ON *.* TO 'yourDatabaseUsername'@'yourVPSIpAddress' WITH GRANT OPTION;
Apply permission changes
Apply all permission changes by flushing privileges.
FLUSH PRIVILEGES;
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
Example:
node.yourdomain.com