Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I want to backup mysql databases to another new server. I don't want to use mysql replication and mysqldump for backup as they are using higher cpu and higher i/o on server. I tried mysqlhotcopy to send databases files to another server into /var/lib/mysql/database but after backup new server shows empty database. Help me friends to find solution. Is there any way to send database raw files using rsync or scp and get recovered database ?

share|improve this question
    
i'ld try rsyncing /var/lib/mysql –  hbdgaf Jun 13 '13 at 4:30
1  
You can't copy a file that's open for writing and expect a consistent result, more so with a database comprising also RAM and file transaction caches. rsync may well work if first you shut down the MySQL server. If taking the database offline is out of the question, you must use database-aware tools to copy a live database. All else is madness. –  Salt Jun 13 '13 at 6:33
    
You have three options. Firstis to take the availability hit and shut-down the DBMS to copy the data folder to the new machine. Second is to take the performance hit and use the native server tools for dumping your data. Third is to take the complexity hit and set-up a hot replication infrastructure. Anything else will result in data inconsistency at best or to data corruption at worst. –  hmayag Jun 13 '13 at 8:04

1 Answer 1

up vote 1 down vote accepted

We can rsync mysql database folder /var/lib/mysql to another server. Mysql versions should be same and server should be shutdown.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.