i found this thread:


will this script backup all databases in the mysql directory?

what do you need to backup and restore all mysql databases in xampp? do i just copy and paste the directory to another location everyday or is there a particular way?

i know you can take backups in php my admin but you would have to do one after another which could be lengthy.

thanks for any help


MySQL has a build in application for both Linux and Windows called mysqldump that creates a text file with the SQL code needed to create the databases, tables, indexes, and insert the data back into your database. You can either export all databases or specific databases to a or several files. Usually I compress the file after creating it to save space.

I run the following every night to backup all databases:

/usr/bin/mysqldump -u root -pmysqlRootPW --all-databases > /var/www/html/txlinux.com/mysql_DB_backup

The big mistake people make is there is no space after the -p when putting in your password but there is a space after the -u for user name.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.