How to synchronize mysql database (security backup)

Asked

Viewed 330 times

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

  • No need to copy td...

  • 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?

  • 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);

  • 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!

  • 1

    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...).

Show 1 more comment

1 answer

0


I decided to, really download..

Browser other questions tagged

You are not signed in. Login or sign up in order to post.