Forums » General Discussion

Thread: How to automate the export of all tables in a MySQL database?

This question is not answered. Helpful answers available: 2. Answered answers available: 1.


Permlink Replies: 0 - Pages: 1
Waterski

Posts: 1
Registered: 7/5/10
How to automate the export of all tables in a MySQL database?
Posted: Jul 5, 2010 10:32 AM
 
  Click to reply to this thread Reply

I'm running Toad for MySQL 4.6.0.531 on Windows.  I'm trying to create a script to automate the exporting of all the tables in a database.  I want to do this as a means of backing up the database.

Using Automation within Toad I have two database activities:
- connection to the database
- export using an existing template file

When I run the script the following output is received:
Automation Logging:7/5/2010 1:00:59 PM: Build started
Automation Logging:7/5/2010 1:01:02 PM: Warning: No Exception Handler. To send an Email when there is an error, change the value of Email on Error to true and enter email values.
Automation Logging:7/5/2010 1:01:02 PM: Build Completed
Automation Logging:7/5/2010 1:01:02 PM: Connecting to xxxxxxxx@yyyyyyyy
Automation Logging:7/5/2010 1:01:02 PM: Connection successful.
Automation Logging:7/5/2010 1:01:02 PM: Running export template C:\Documents and Settings\xxxxxxxx\Desktop\MyTimeTemplate.txp
Automation Logging:7/5/2010 1:01:02 PM: Done

When I look in the destination directory as specified in the template there are no files to be found.

If I do:
Tools > Export > Execute Export Template...
and execute the same template as the script does, it works with the following output:
Automation Logging:7/5/2010 1:00:59 PM: Build started
Automation Logging:7/5/2010 1:01:02 PM: Warning: No Exception Handler. To send an Email when there is an error, change the value of Email on Error to true and enter email values.
Automation Logging:7/5/2010 1:01:02 PM: Build Completed
Automation Logging:7/5/2010 1:01:02 PM: Connecting to xxxxxxxx@yyyyyyyy
Automation Logging:7/5/2010 1:01:02 PM: Connection successful.
Automation Logging:7/5/2010 1:01:02 PM: Running export template C:\Documents and Settings\xxxxxxxx\Desktop\MyTimeTemplate.txp
Automation Logging:7/5/2010 1:01:02 PM: Done
Statusbar:7/5/2010 1:06:03 PM: Export Started [48]
Statusbar:7/5/2010 1:06:05 PM: Export Finished [48], click View Report for summary

This time when I look in the destination directory as specified in the template there is one .sql file for each table in the database.

Can someone tell me what I'm doing wrong?

Thanks



Legend
Guru: 2001 + pts
Expert: 751 - 2000 pts
Enthusiast: 31 - 750 pts
Novice: 0 - 30 pts
Moderators
Helpful answer (5 pts)
Answered (10 pts)

Point your RSS reader here for a feed of the latest messages in all forums