Page 1 of 1

How to take database back up in Mysql

Posted: Wed Oct 14, 2009 7:53 am
by sajith
hi,can some one help me

How to take database back up in Mysql and also to restore it back.

regards,
sajith

Re: How to take database back up in Mysql

Posted: Wed Oct 14, 2009 9:55 am
by anserkk
How to take database back up in Mysql and also to restore it back.
Use MySQL Administrator, there you have Backup and Restore.

Till now I have not tried to take MySQL backup using FWH application. I believe that somebody here may be able to help you in this regard

Regards
Anser

Re: How to take database back up in Mysql

Posted: Wed Oct 14, 2009 10:36 am
by sajith
Dear Anser,Many Many thanks for ur Help

Regards,
sajith

Re: How to take database back up in Mysql

Posted: Wed Oct 14, 2009 2:59 pm
by Armando
sajith:

You can do a backup/restore using your own code.

Please take a look to MySql manual

http://dev.mysql.com/doc/refman/5.0/es/backup.html

Regards

Re: How to take database back up in Mysql

Posted: Thu Oct 15, 2009 6:06 am
by anserkk
Dear Mr.Armando,

I understand that there are some difficulties for taking MySQL backup from an application using the command line tool "mysqldump.exe" either from FWH, VB or any application

Reason:

The reason is that the mysqldump.exe is available only on the MySQL Server installation directory. (C:\Program Files\MySQL\bin\ on my MySQL server).

You can take backup with the mysqldump.exe if our apllication is running on the the same PC/Server running MySQL database Server.

Suppose if you need to take MySQL database back using FWH app installed on many PC's on the network and you need to take MySQL backup from any client PC on the network, then you need to have a copy of mysqldump.exe on each and every PC

I assume, FWH WaitRun() can be used

Command
mysqldump --host=host_ip --port=port_num -u UserName --password=password --all-databases --opt -c > c:\Backup\BACKUP_FILE.SQL

I have not tested it personally

Do you have any sample for Restore ?

Regards
Anser

Re: How to take database back up in Mysql

Posted: Thu Oct 15, 2009 1:16 pm
by Armando
Mr. Anserkk
anserkk wrote: I understand that there are some difficulties for taking MySQL backup from an application using the command line tool "mysqldump.exe" either from FWH, VB or any application
Yes you are right, it's not easy.
anserkk wrote: Do you have any sample for Restore ?
Unfortunately not, sorry :(

Regards

Re: How to take database back up in Mysql

Posted: Fri Oct 16, 2009 3:14 am
by Willi Quintana
Hello,,,
I use this command for backup....
SELECT * INTO OUTFILE 'e:\BACKUPS\productos.txt' FROM productos

for restore....
LOAD DATA INFILE 'e:\BACKUPS\productos.txt' INTO TABLE productos

Regards
Willi

PD (my English is bad,,, sorry)

Re: How to take database back up in Mysql

Posted: Fri Oct 16, 2009 3:18 am
by Willi Quintana
Hi,,,
SELECT * INTO OUTFILE 'e:\BACKUPS\productos.txt' FROM productos
and
LOAD DATA INFILE 'e:\BACKUPS\productos.txt' INTO TABLE productos
is available only on the PC with MySQL Server

Regards
Willi

Re: How to take database back up in Mysql

Posted: Fri Oct 16, 2009 6:10 am
by anserkk
Dear Mr.Willi,

Thanks.
SELECT * INTO OUTFILE 'e:\BACKUPS\productos.txt' FROM productos
and
LOAD DATA INFILE 'e:\BACKUPS\productos.txt' INTO TABLE productos
The problem that I understand with the above command is that it will generate only the backup of the data in text format and not the structure of the tables. Whereas the output created from mysqldump.exe generates a script containing the SQL for the tables structures creation with Insert SQL statements to insert data's to the table, which is highly portable.

Regards
Anser

Re: How to take database back up in Mysql

Posted: Fri Oct 16, 2009 9:54 pm
by Willi Quintana
Dear Mr. Anser
You want to make a backup of data or want to export data?
for backup, you must first create the database from your application and may make the restore from the txt file
personally successfully use this sentence to all tables in the database .

Regards
Willi