Web Hosting Talk







View Full Version : How to backup all the databases on a server ???


hoot
03-13-2002, 10:16 AM
Hi, I've got a plesk machine with rackshack and they are just about to do a restore...
I've got a customer with some big databases and when I make a backup the normal way and try and set up the tables on a different database phpmyadmin just times out.
I know that all the files are kept in /usr/local/psa/mysql/var so I did a test (not knowing much about mysql)
I removed a directory called test (rm -R test)
Then I copied another directory called dir2 like this :
cp /usr/local/psa/mysql/var/dir2 /usr/local/psa
then I renamed it to test :
rename /usr/local/psa/mysql/var/dir2 test
then I copied it back to the var directory :
cp /usr/local/psa/test /usr/local/psa/mysql/var/
Then I restarted mysql: /usr/local/psa/rc.d/mysqld restart

But Phpmyadmin gives off this error :
Can't read dir of './test/' (Errcode: 13)

are there any special permissions etc that I'm supposed to give the files etc ... ??

thanks for the help !

Abu Mami
03-13-2002, 10:52 AM
phpmyadmin will time out since it's a PHP script. There are ways to override this, but you don't really want to do that.

Also, trying to play directly with the mysql files won't work.

You can run mysqldump to get a backup. A typical line might look something like this.
   mysqldump -hdbhost -udbuser -pdbpass $dbname > backup
You'll probably want to look at the docs. Well, actually, you won't want to look at the docs, but you're gonna have to.

mlx
03-13-2002, 11:59 AM
you can use the following to restore the database:
mysql -uUSERNAME -pPASSWORD DATABASENAME < /path/to/backup.sql