Some servers have tables that are constantly being updated (or if dump is ran at high traffic), locking the table during the dump refused some important sql queries while it was running.
Also large database dumps take time. Some may be inconsistent but it’s nothing that can’t be fixed by editing the SQL file.
I’ve been using this method for a while now without ever being unable to retrieve the dumped data.
yes I understand the theory my question was more related to the FiveM ESX database
So is it necessary for that specific database?
I am making a backup for my database and the .sql file is almost 4MB (not that big I guess), but I have never experienced an error in the backup, that is why I was curious if you set that parameter based on negative experience.
I wouldn’t say it’s necessary, it all depends on how your server addons are set up and when you’re executing the dump.
You can lock it but keep in mind most queries sent to the SQL server will be rejected during the dump (INSERT, DELETE, UPDATE statements) if the dump is at that table at the time, I keep it turned off due to economy and discord addons that constantly update a table.
Please follow the instructions in the original post.
CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'password';
GRANT PROCESS ON *.* TO `newuser`@`localhost`;
GRANT SELECT ON `yourdatabase`.* TO `newuser`@`localhost`;
I’m having the same issue as Spooner, I’ve tried logging the error file but that file doesn’t create, so I’m assuming there are no errors? All I’m getting is an empty SQL file.
This is what my .bat file reads;
cd C:\xampp\mysql\bin mysqldump -ubackup -ppassword main --single-transaction --quick --lock-tables=false > C:\FiveMDBBackups\fiveMbackup_%date:~-10,2%-%date:~-7,2%-%date:~-4,4%.sql --log-error=C:\FiveMDBBackups\error_file.log
For some reason it’s still not populating. This time it’s not empty, as it shows MariaDP information with commented out time zone settings and such, but still empty. When you say ‘databasename’, in my case my database is called ‘main’, is that what I would enter there? That’s what I have and it’s not populating.
You also mentioned to change it asap, are you referring to not using xampp? I’ve been using MySQL natively for a year and it corrupted my files 2 days ago, so this was the solution I went with instead.
Regarding xampp on server; xampp is not meant to be run in a production environment, now if you know how to set it up correctly and patch all the security flaws you’re good but straight out of the box xampp will expose some aspects of your server.
How has native MySQL broken your files? I’ve been using MySQL 8.0 on all by server builds running fivem and none had issues, I generally try to avoid Microsoft SQL but MySQL has proven good in my case.
I did give my user the proper rights when doing this, but I might have done something wrong. I followed the exact query you posted.
What happened with MySQL is that I had to restart the server because of a change I had to make to the my.ini (lift restrictions for new tables, something I was adding MySQL didn’t like). This was a very simple process, but upon restarting the service, MySQL didn’t start back up. All files from the folders were corrupted, tried recovering in many different ways.
When I tried to completely re-instal MySQL, the installer wasn’t working, wouldn’t want to install the server, so I went with a solution that worked, which was xampp
But back to this issue here, can I use the root account to do this, which would theoretically have all access? Would that work?
I used the Services window as in your screenshot, and I had the exact same thing, MySQL80, I hit restart, and when it tried to boot back up it said it “started and shut down again” due to an error. I’ve been up and down stackoverflow and none of the resolutions worked for me unfortunately
Yeah, the issue was that there were no .frm files, only .ibd and the main backup files, but MySQL Workbench/HeidiSQL didn’t recognize anything I tried to open, so this time around i’m just trying to take preventable measures.