friedemann_bach Posted June 17, 2009 Share Posted June 17, 2009 Hello all, I have designed a small MySQL database frontend with PHP and I want to provide a backup function that creates a dump of the whole database. Usually, I would have used mysqldump with the usual command line options. However, mysqldump does not work here, as the PHP server does not have mysql installed. The mysql server is running on another machine. How can I make a complete database backup in this case - using only PHP and MySQL commands? Thank you very much for your help. Quote Link to comment https://forums.phpfreaks.com/topic/162545-solved-backing-up-a-mysql-database-without-mysqldump/ Share on other sites More sharing options...
trq Posted June 17, 2009 Share Posted June 17, 2009 Take a look at mysql's SELECT syntax (here). You can use the INTO clause to send to a file. eg; mysql_query("SELECT * INTO OUTFILE 'filename.sql' FROM tblname"); Quote Link to comment https://forums.phpfreaks.com/topic/162545-solved-backing-up-a-mysql-database-without-mysqldump/#findComment-857859 Share on other sites More sharing options...
friedemann_bach Posted June 18, 2009 Author Share Posted June 18, 2009 Thank you very much for this hint! Quote Link to comment https://forums.phpfreaks.com/topic/162545-solved-backing-up-a-mysql-database-without-mysqldump/#findComment-859000 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.