SergioFeitoza Posted April 13, 2021 Share Posted April 13, 2021 My Unigui code is running as a service i tne web. It uses a small MySql database . How to do a code to backup dayly the database, for example a a *.sql file ? Quote Link to comment Share on other sites More sharing options...
picyka Posted April 13, 2021 Share Posted April 13, 2021 Há 2 horas, SergioFeitoza disse: Meu código Unigui está sendo executado como um serviço i tne web. Ele usa um pequeno banco de dados MySql . Como fazer um código para fazer backup diário do banco de dados, por exemplo, um arquivo *.sql? You can create a bat file with the backup script and schedule on windows Quote Link to comment Share on other sites More sharing options...
x11 Posted April 14, 2021 Share Posted April 14, 2021 https://www.google.com/search?client=firefox-b-d&q=mysql+automaticaly+backup 1 Quote Link to comment Share on other sites More sharing options...
Mohammed Nasman Posted April 14, 2021 Share Posted April 14, 2021 10 hours ago, SergioFeitoza said: My Unigui code is running as a service i tne web. It uses a small MySql database . How to do a code to backup dayly the database, for example a a *.sql file ? I use a batch file that uses mysqldump.exe & Windows Task Scheduler. Quote Link to comment Share on other sites More sharing options...
Mohammed Nasman Posted April 14, 2021 Share Posted April 14, 2021 The batch file as following: Backup.bat set datestr=%date:~6,4%-%date:~3,2%-%date:~0,2% "C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqldump.exe" -uUser -pPassword --databases DB1 DB2 > f:\bk\Backup_%datestr%.sql; exit Then create a job on Windows Task Scheduler to run the batch file on daily basis, if the database on linux, create a cron job for it. Quote Link to comment Share on other sites More sharing options...
SergioFeitoza Posted April 14, 2021 Author Share Posted April 14, 2021 10 hours ago, picyka said: You can create a bat file with the backup script and schedule on windows Thank you Quote Link to comment Share on other sites More sharing options...
SergioFeitoza Posted April 14, 2021 Author Share Posted April 14, 2021 3 hours ago, x11 said: https://www.google.com/search?client=firefox-b-d&q=mysql+automaticaly+backup Thank you very much There are several possibilities here !!! Quote Link to comment Share on other sites More sharing options...
SergioFeitoza Posted April 14, 2021 Author Share Posted April 14, 2021 2 hours ago, Mohammed Nasman said: The batch file as following: Backup.bat set datestr=%date:~6,4%-%date:~3,2%-%date:~0,2% "C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqldump.exe" -uUser -pPassword --databases DB1 DB2 > f:\bk\Backup_%datestr%.sql; exit Then create a job on Windows Task Scheduler to run the batch file on daily basis, if the database on linux, create a cron job for it. Thank you Mohamed . I will check how to do this. Possibly is one of the possibilities detailled in the link above posted by x11 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.