Issues connecting to Database on Linux VPS

Does anyone here know much about running a FiveM ESX server through Pterodactyl Panel? On Pterodactyl it’s refusing the connection to the database, but on my Windows machine it works fine with the same setup.

The errors I get are: [ERROR] connect ECONNREFUSED 127.0.0.1:3306

ERROR] [MySQL] [es_extended] An error happens on MySQL for query "SELECT * FROM items": connect ECONNREFUSED 127.0.0.1:3306

[ERROR] [MySQL] [es_extended] An error happens on MySQL for query "SELECT * FROM jobs": connect ECONNREFUSED 127.0.0.1:3306

SCRIPT ERROR: @es_extended/server/common.lua:23: bad argument #1 to 'for iterator' (table expected, got nil)

Like I said the exact same config works on my Windows machine, just not my Ubuntu 16.04 VPS.

Any help would be very much appreciated!

Thanks!

Hi! I’ve got my server running on a similar setup (Ubuntu 18.04) and had difficulties myself to connect my server to the database.

For starters, use the connection string as so: set mysql_connection_string "server=ServerIP;port=3306;uid=MySQLUsername;password=Password;database=essentialmode" . For me, using localhost or 127.0.0.1 on server= did not work, so make sure you’re putting in your actual IP address on that.

If the issue still remains I suggest you look over your Firewall and make sure your 3306 port is open on TCP and UCP, and that your database user has access from % (all connections).

I’m more than happy to assist you if you’ve got any other questions, I myself took 2 weeks until my server was 100% up and running so I know the frustration you’re going through.

Thank you for the help, I will try that string, I have tried putting the public IP address of the VPS in to no avail, how would I go about and verify that Maria DB is accepting connections publicly? I do have PHPMyAdmin installed aswell and under my.cnf for MySQL I have 0.0.0.0 bound in both places and uncommented, so that should accept inbound connections?

Thanks!

Edit: I was also wondering should I use the built-in database section for Pterodactyl?

Update, I’ve tried that string with my details to no avail, how should I go about opening MariaDB to external connections?

Thanks in advance!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.