Any quick way to backup all clients mysql

albertg

Well-Known Member
PartnerNOC
Sep 4, 2002
61
0
156
Hello People.

May i ask whether is there any quick way to backup all client mysql db?

Any assistance is very much appreciated.
 

thomas

Well-Known Member
Mar 31, 2002
70
0
306
All db's are stored in: /var/lib/mysql/

Just make a backup of that dir.
 

shaun

Well-Known Member
PartnerNOC
Verifed Vendor
Nov 9, 2001
702
1
318
San Clemente, Ca
cPanel Access Level
DataCenter Provider
Twitter
mysqldump -A & all-mysql-dbs.sql

This will create one file on your server called all-mysql-dbs.sql and it will contain every database inside.

Just fyi, to restore individual db's via this file is kind of a pain in the ass because this file has every db in it. If you wanted seperate .sql files you could do somthing like this.

for i in `mysql -e &show databases&`;do echo &Backing Up $i&;mysqldump $i & $i.sql;done

It will give a error in the beggining saying &mysqldump: Got error: 1049: Unknown database 'Database' when selecting the database& Ignore that... i could chop off the first line i guess :)