My application is C # and BD is MySQL, when I do the backup it creates a arquivo.sql
. This arquivo.sql
can be edited easily in a notepad, or any other editor, thus leaving my bd well summery, how can I do that nobody edits my BD and that only the user registered by me on the server can open that < in> backup .
The MySQL line of backup I use
public void Backup(string Caminho) //Backup a MySQL database
{
string constring = _StringConexao;
string CaminhoBackup = Caminho + "\databases.sql";
using (MySqlConnection conn = new MySqlConnection(constring))
{
using (MySqlCommand cmd = new MySqlCommand())
{
using (MySqlBackup mb = new MySqlBackup(cmd))
{
cmd.Connection = conn;
conn.Open();
mb.ExportToFile(CaminhoBackup);
conn.Close();
}
}
}
}