Need to provide this facility on a button-click in my web application. Could be done using mysqldump, but for that I’d have to start an external process? (the command prompt)
Is there a simple SQL query that lets us backup and restore databases? (particularly for MySQL)
If you use MySQL 6, you’re fine — see http://dev.mysql.com/doc/refman/6.0/en/backup-database-restore.html . If you’re on MySQL 5, things aren’t so rosy — you’re probably better off with the mysqldump / external process approach.