How do you guys backup your MySQL databases? I have a few programs that have an default back up that make an .sql file which is great but I also use OpenX which runs on PHP and has a database. That does not have an auto-back-up feature so do I just download the database and that's it? Any recommend for the tool? Thanks
To Import SQL file mysql -u USER -p DBNAME < dump.sql To Backup to SQL file mysqldump -u USER -p DBNAME > dump.sql
I prefer mysqldump as it is owned my mysql itself so for me it is the most authenticated tool. It is command line and some time takes more time but it is worthy. For simple backup like for a one or few table mysql also has its own command as follow $query = "SELECT * INTO OUTFILE $filename FROM $tablename";
mysqldump preferred here also, and for InnoDB add --single-transaction --opt to your mysqldump options