[Release] [Standalone] Automatic SQL Backup

Fivem SQL Dump

  • It’s a code to dump/backup your database into a .sql file automatically.
  • The dump happens on the moment that you starts your server, it took just some seconds.
  • Very simple installation/ configuration.

Installation

  1. Download MySQL Async
  2. Download Fivem SQL Dump
  3. Start both scripts (MySQL must be first)
  4. Configure the Dump
  5. Done

Config File

  • You must set your Database name and the tables that you wanna dump

Requiments

  • It’s standalone, works on any framework

Bugs

  • Please, report here if you found any bugs
  • If you are using an older version of MySQL Async:
  1. Change the first line in sv.lua:

MySQL.ready(function ()

To:

AddEventHandler(‘onMySQLReady’,function()

7 Likes

Very cool!!! Although it probably is better to do this with a scheduled task/cron for security purposes

1 Like

Im sorry, but no.

If people wanted to dump their DB, there are more appropriate ways of “dumping” it that are built into the MySQL.

Your method will only work if the SQL User has access to the levels it needs based on permissions.

The smart people out there will have a SQL user login that is restricted to SELECT, INSERT, UPDATE and DELETE. Maybe even FILE. Listed as the connection user for FiveM.

I am not trying to discredit your work.
I am just trying to get people to realise there are vulnerabilities to your method that can cause major issues.

I know that it has vulnerabilities, but it is a open source code. I just select all registers then write all in a file. I cant cause any major issue…

Hey I’m pretty new to SQL administration. Care to explain what you mean by having a user login with only those permissions for backing up the DB? I understand what you mean just don’t understand the logic behind it. Thanks!

Note quite right as the user accessing thr DB has nothing to do with backups, its just this script in particular uses CREATE, and thats a higher level permission, I know the vast majority of servers out there with people such as yourself don’t know too much, so they probably use root as default not caring too much about it.

This means, someone can just manipulate the SQL Query because its not even using the parameters within the code.

Now, it is only server side, so unless a client knew the server had it on it and the name of the database, there probably isnt much risk.

But every MySQL host has built in features for dumping backups and should be used rather than relying on a resource…

Note quite right as the user accessing thr DB has nothing to do with backups, its just this script in particular uses CREATE, and thats a higher level permission, I know the vast majority of servers out there with people such as yourself don’t know too much, so they probably use root as default not caring too much about it.

Makes total sense, thanks for explaining it. I appreciate it

Hey nice release, but how could i connect to a host that has password, another username another host?

This use only local connection, so it’ll backup only de database where your server was started from

ok, thanks

Where is the Location of the Dump file?