I am tasked with writing a data transfer utility and one requirement is that I copy an entire MySQL database from one server to another. The user will simply click a button when they want the database transfer to occur.
I am a little inexperienced with databases, but I worked with them enough to know how to do what I need to do. What is the quickest way of doing this?
My original idea was do this:
Is there a better, more efficient way to do this?
DataTables take up quite a bit of memory. Be careful with this approach, as database size grows, so does the likelyhood that this method will fill up your memory. I would look at using the mysql command line to backup / restore and call those commands from your code.
Using Process.Start Method =>
Process process = new Process();
// Configure the process using the StartInfo properties.
process.StartInfo.FileName = "process.exe";
process.StartInfo.Arguments = "-n";
process.StartInfo.WindowStyle = ProcessWindowStyle.Maximized;
process.Start();
process.WaitForExit();// Waits here for the process to exit.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.