harishkumar09 Posted April 14, 2008 Share Posted April 14, 2008 I have a phpBB forum running on H-SPHERE Control Panel. For some reason I am unable to take take the backup of the forum and my hosting provider is not being of much help either. So I was just wondering if I could just take a backup of my forum by reading all the information from the Database Tables by executing SQL queries from PHP ? Is it possible ? Can I just read it off and output it to a text file and later use it to restore (duplicate) the DB tables ? Link to comment https://forums.phpfreaks.com/topic/101082-using-php-to-take-a-backup-of-a-mysql-db/ Share on other sites More sharing options...
discomatt Posted April 14, 2008 Share Posted April 14, 2008 Are you using phpmyadmin? Link to comment https://forums.phpfreaks.com/topic/101082-using-php-to-take-a-backup-of-a-mysql-db/#findComment-516902 Share on other sites More sharing options...
craygo Posted April 14, 2008 Share Posted April 14, 2008 if you have ftp just upload phpmyadmin and it will do it for you. if not you can start there, look into the code in phpmyadmin to start it. Ray Link to comment https://forums.phpfreaks.com/topic/101082-using-php-to-take-a-backup-of-a-mysql-db/#findComment-516904 Share on other sites More sharing options...
rhodesa Posted April 14, 2008 Share Posted April 14, 2008 Do you have access to your server via SSH? p.s. - There is no easy way to export the data with PHP's MySQL functions. There might be some script out there that someone wrote, but I don't have one. I use the mysqldump command line tool via an SSH shell: mysqldump --opt -h <hostname> -u <user> -p <pass> <db_name> > <backup_filename>.sql"; I then wrap the above command in a PHP script, which does some error checking and emails me with problems. Then, I execute that PHP script with a cronjob. Link to comment https://forums.phpfreaks.com/topic/101082-using-php-to-take-a-backup-of-a-mysql-db/#findComment-516907 Share on other sites More sharing options...
unidox Posted April 14, 2008 Share Posted April 14, 2008 Just a quick google search came up with many tutorials: http://www.google.com/search?q=backup+mysql+using+php&sourceid=navclient-ff&ie=UTF-8&rlz=1B3GGGL_enUS269US270 Link to comment https://forums.phpfreaks.com/topic/101082-using-php-to-take-a-backup-of-a-mysql-db/#findComment-516908 Share on other sites More sharing options...
harishkumar09 Posted April 15, 2008 Author Share Posted April 15, 2008 Just a quick google search came up with many tutorials: http://www.google.com/search?q=backup+mysql+using+php&sourceid=navclient-ff&ie=UTF-8&rlz=1B3GGGL_enUS269US270 That was really a very good search unidox. In fact I did try searching before posting here. Can you give me some links that teach you how to make effective searches ? Link to comment https://forums.phpfreaks.com/topic/101082-using-php-to-take-a-backup-of-a-mysql-db/#findComment-517423 Share on other sites More sharing options...
harishkumar09 Posted April 15, 2008 Author Share Posted April 15, 2008 Are you using phpmyadmin? Yes. But you know what , the database is not listed in phpMyAdmin at all. Link to comment https://forums.phpfreaks.com/topic/101082-using-php-to-take-a-backup-of-a-mysql-db/#findComment-517424 Share on other sites More sharing options...
discomatt Posted April 15, 2008 Share Posted April 15, 2008 Perhaps you are using a restricted user for phpmyadmin. Edit the config file and make sure the sql user you enter has permissions for the DB. phpmyadmin has a built in backup function Link to comment https://forums.phpfreaks.com/topic/101082-using-php-to-take-a-backup-of-a-mysql-db/#findComment-517460 Share on other sites More sharing options...
harishkumar09 Posted April 15, 2008 Author Share Posted April 15, 2008 Perhaps you are using a restricted user for phpmyadmin. Edit the config file and make sure the sql user you enter has permissions for the DB. phpmyadmin has a built in backup function Where do I find the config file and how do I do it ? Link to comment https://forums.phpfreaks.com/topic/101082-using-php-to-take-a-backup-of-a-mysql-db/#findComment-517770 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.