Re: backing up MySQL

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



use the following script
##############
#!/bin/sh

# Create the temporary copy directory
mkdir /tmp/mysql

# Get the list of MySQL Databases & copy them

for var in `find /var/lib/mysql/ -type d | \
sed -e "s/\/var\/lib\/mysql\///"`; do
mysqlhotcopy -q "$var" /tmp/mysql
done

# Tar/gzip data

date=`date -I`
tar czf /tmp/mysql-$date.tar.gz -C /tmp/ mysql/
#############################

or use :

mysqldump command

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux