Reputation: 10658
i am creating a small tool using C# and MySQL, this tool has a small db in MySQL i want to backup the DB as a .SQL file that i can again load to MySQL when needed.
the problem is how to get .SQL file on client side using any query etc. and load it back to db.
i don't want to use sql dump or any other method for which i have to write a batch file or call an external process on client.
is there any simple and straight forward way to it with c# programming
help needed regards.
Upvotes: 0
Views: 510
Reputation: 122002
All object definitions you can get using SHOW CREATE TABLE, SHOW CREATE VIEW, SHOW CREATE TRIGGER, ... and so on; all objet names you can get from information_schema system database.
Only 'INSERT INTO table' statements you should generate itself.
Upvotes: 1