0
I have a website hosting files, (file server), I synchronize the files with another server.. in case something happens I have a copy of all the files.. But is there any way to always save a copy of the database automatically ? I always need to go to phpmyadmin and export tables ?
The files are automatically synchronized by a CRON, has to do the same or something like mysql ?
Usually the servers have a daily backup option, usually charge about 20 real or something like
– Woton Sampaio
No need to copy td...
– Woton Sampaio
If you don’t want to pay, and you want to keep sending everything to another database, why don’t you make a double connection? Type, when an Insert occurs in a db, occurs in the other tb?
– Woton Sampaio
It would only be to connect the two in the msm php file:
$mysqli = new mysqli("host", "user", "senha", "db");
$mysqli2 = new mysqli("host2","user2", "senha2", "db2");

$query = "INSERT INTO minha_tabela ...";

$mysqli->query($query);
$mysqli2->query($query);
– Woton Sampaio
tries to dump the bank, even if it is a remote server. Then just schedule the dump.... I think you can do it: https://dev.mysql.com/doc/refman/8.0/en/mysqldump.html Just one remark about connecting to two banks: What gambiarra ein!
– Rovann Linhalis
Synchronization is one thing, backup is another. Backup cannot be changed. Synchronization is mere physical distribution. If you do a wrong update on the original, the synchronized one also spoils. I have seen "technology" company lose data pq kept in Sync (and it was not for lack of warning that Sync is not backup...).
– Bacco