views:

17

answers:

1

I try to back up from MySQL with codes. Is it possible?

If it will possible, I could use this code getting backup from MsSQL.

Thank a lot.

A: 

The easiest way is to use the command-line tool mysqldump.

mysqldump -u username -ppassword -h hostname databasename > filename.sql 

It can create dumps from local or remote databases.

It is a part of the mySQL installation package (in the /bin directory)

Pekka
I dont wantto back up on command line. I have to back up with code.
john
@john That is possible, but it's *quite* complex to achieve as you have to replicate what the dump tool does. You're in for quite a lot of work. Think twice whether that is the perfect solution to your problem.
Pekka