Mysql-native - full database backup

Geert via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Jan 5 06:13:49 PST 2017


On Thursday, 5 January 2017 at 01:16:09 UTC, crimaniak wrote:
> On Monday, 2 January 2017 at 15:29:08 UTC, Geert wrote:
>> Hi!
>>
>> How can i create a full database backup using mysql-native for 
>> D?
>  Too common question. Do you have problems with driver usage? 
> Do you have problems with database backup schema?

Sorry for not being specific, my english it's not quite good. I 
thought i could use a specific mysql-native method (like 
"execProcedure") for making database backups, but it seems it 
doesn't have it.

Anyway, i ended up using mysqldump with executeShell function:

string query = "mysqldump -uroot -ptest_pass test_db > 
/home/user/mydb_backup.sql";
executeShell(query);


For those who use lampp:

string query = "/opt/lampp/bin/mysqldump -uroot -ptest_pass 
test_db > /home/user/mydb_backup.sql";
executeShell(query);


More information about the Digitalmars-d-learn mailing list