How do I connect my bot to a database?
Create the database in the panel, restrict the allowed hosts and set up a secure connection.
Use the service’s Databases page when your plan includes this quota. The credentials shown are separate from your ACLClouds account.
Step-by-step procedure
-
Create the database
Open Databases, enter a name and restrict connections to the required host.
-
Copy the settings
Note the host, port, database name, user and password from the panel.
-
Create variables
Store settings in separate variables or a DATABASE_URL, never in Git.
-
Test the connection
Run a simple query at startup and handle reconnections without an aggressive retry loop.
-
Back up
Regularly export data with the appropriate tool before migration or deletion.