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? Quote 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. Quote 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 Quote 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? Quote 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() Quote 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. Quote Link to comment https://forums.phpfreaks.com/topic/92136-mysql-backup/#findComment-472029 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.