Skip to main content

Creating a Database Using CLI

Creating a new database and user using the CLI might be necessary for self-hosted bare metal instances or self-hosting Pterodactyl instances which do not have server databases setup.

Entering the MariaDB CLI

Enter the MariaDB CLI:

sudo mysql -u root

You may need to change this command based on your installation!

Creating the VoiceTwine User

You'll need to create a user dedicated to the VoiceTwine installation. Using root or privileged user credentials is not recommended.

create user 'voicetwine'@'127.0.0.1' identified by '<secure password>';

You might need to modify the host based on your configuration.
Self-hosted installations (pm2 or systemd): 127.0.0.1 is usually the best option to only allow local connections.
Pterodactyl installations: % (all hosts) might be necessary to allow connections from docker containers.

Creating the Database

create database voicetwine;

Assign Privileges

grant all privileges on voicetwine.* to 'voicetwine'@'127.0.0.1' with grant option;
-- Remember to modify the host (127.0.0.1) to match the one used when the user was created!

Update Environment Variables

MariaDB setup is nearly completed! Next, copy the database host, port, username, password, and database name to your environment.

For self-hosted installations, this will be the .env file in the app directory. For Pterodactyl installations, it's located in the Startup tab on the panel.

For Pterodactyl installations, you will need to use the IP of the Docker network interface to reach MariaDB. This is usually 172.18.0.1