Isityou Posted February 20, 2008 Share Posted February 20, 2008 I want to backup my MySQL databased via PHP. Is there a PHP function that allows you to export a whole .sql file? Link to comment https://forums.phpfreaks.com/topic/92136-mysql-backup/ Share on other sites More sharing options...
fenway Posted February 20, 2008 Share Posted February 20, 2008 No... you'll have to run sql commands (SELECT INTO OUTFILE) or mysqldump. Link to comment https://forums.phpfreaks.com/topic/92136-mysql-backup/#findComment-471886 Share on other sites More sharing options...
rhodesa Posted February 20, 2008 Share Posted February 20, 2008 I've never done it, but I've heard a lot of people crack open phpMyAdmin and use it's code for doing the exports Link to comment https://forums.phpfreaks.com/topic/92136-mysql-backup/#findComment-471889 Share on other sites More sharing options...
Isityou Posted February 20, 2008 Author Share Posted February 20, 2008 So I must format the export myself? Link to comment https://forums.phpfreaks.com/topic/92136-mysql-backup/#findComment-471991 Share on other sites More sharing options...
rhodesa Posted February 20, 2008 Share Posted February 20, 2008 php has no export capability, you will either have to: 1) Generate the SQL yourself (from scratch or digging through phpMyAdmin for their code) 2) Use the mysql command line utility called mysqldump. You could use PHP to run this command via exec()/system()/passthru() Link to comment https://forums.phpfreaks.com/topic/92136-mysql-backup/#findComment-472021 Share on other sites More sharing options...
fenway Posted February 20, 2008 Share Posted February 20, 2008 So I must format the export myself? phpmyadmin does have some backup functionality, AFAIK. Link to comment https://forums.phpfreaks.com/topic/92136-mysql-backup/#findComment-472029 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.