Backup remote MySQL database from local machine
I am creating an wpf application which gives user an option to backup an mysql db.I want to get this done in C# coding.
I know that it can be easily done using mysqldump, but i am stuck in an scenario where there is no mysql server installed on local machine and the user wants to back up the db located on remote machine.
So here's where i need help or any suggestion how this can be achieved as i will not get the mysqldump on local machine as mysql server is not insstalled. I also know that back of mysql db is not possible without using mysqldum utility provided by MySql.[did an google over here and didnt found any helpfull post].
What I tried :
I was trying to embed the mysql dump with an application but开发者_开发百科 somehow i was not able to.
What I want to achieve :
I want to create an back up of mysql db even though the user havn't installed the mysql server on his local machine.
EDIT : Is there an MySqlCommand which backups the db like the ms sql server one
[ BACKUP DATABASE inventory TO DISK]
This is just for the data, not the table structures, triggers, etc: an exporter to XML, see here
Get a list of the tables:
SHOW TABLES;
Get an SQL statement that will create the table:
SHOW CREATE TABLE table_name
Use SELECT * FROM table_name
to get the rows and format them like
INSERT INTO (some_field
, another_field
, ...) VALUES ('one','two',...)
You can try SQLyog's Scheduled backup/Backup as SQL dump to backup remote MySQL database from local machine. If you have installed SQLyog on local machine you can connect to the remote server and backup using SQLyog.
精彩评论