Minor mistake in the code snippet above.
Forgotten to get rid of the "echo $sql;" which will cause error in execution of the script.
Main Topics
Browse All TopicsI want to download a full dump of a MySQL database without the use of bulky applications like PHPMyAdmin.
I want to download the entire database, including structure and content for all tables and fields.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Are you saying that you cannot use PHP fopen() function on your own server? Why not? I would try to remedy this, if I were you. Being able to use the file system is part of the PHP core. It will make life much easier!
I can show you a way that I have used to back up MySQL data, but it would need to write the backup file somewhere.
An alternative architecture might be to use a CRON job to copy the data base.
Best regards, ~Ray
Business Accounts
Answer for Membership
by: AllentkwPosted on 2009-10-11 at 07:00:03ID: 25545923
Hiya!
browse/pac kage/3498. html
There is a class written in php to do a database dump.
Take a look into this link: http://www.phpclasses.org/
Check out the code snippet for an example usage with your script.
There are also other ways of using the class, like exporting just the table structure, data only and other modes. Also, it includes of outputting in compressed file.
Select allOpen in new window