Connecting Your Server to a Database
Integrating your server with a database is crucial for using frameworks or other resources. Follow these steps to establish the connection. Note that different resources or frameworks might require unique configurations, so always check the relevant documentation.
-
Prepare Your Database
Ensure that your database is set up and that you’ve imported all the SQL files included with your resources. -
Edit Your Configuration File
Open yourserver.cfg
file. If you need guidance on using WinSCP to access files, refer to the appropriate instructions.Add the following lines at the beginning of the file:
set es_enableCustomData 1 set mysql_connection_string "server=HOST;uid=USERNAME;password=PASSWORD;database=DBNAME"
-
Update Connection Details
Replace the placeholder values with your actual database information:- HOST: Your database server IP address.
- USERNAME: Your database username.
- PASSWORD: Your database password.
- DBNAME: The name of your database.
-
Save and Restart
Save the changes to yourserver.cfg
file and restart your server to apply the new settings. -
Locate Your Database Credentials
Access your control panel and navigate to the database section to find the necessary credentials:- Database Name: Find this in your database settings.
- Database User: Click the eye icon to view the username.
- Database Password: Click the eye icon to reveal the password.
- Database IP/Host: Click the eye icon to get the IP address or hostname.