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.

How to restore on another Ubuntu computer a MySQL database backup made by rsnapshot on an external USB hard disk? This seems to be difficult because the UID and GID of mysql differ on both computers.

I could work around by determining UID and GID of mysql on the target computer, copying the database in /var/log/mysql/ and running the command ~$ chown -R newuser:newgroup newdir.

Is there a more straightforward solution?

[Backup on Ubuntu 12.04, Restore on Ubuntu 10.04.4]

share|improve this question
2  
I've noticed your accept rate is low. If possible, please consider closing some of your other open questions by selecting the best answer (if they have one). Consider which answers have been useful and need an upvote. We need users to maintain their questions so that the site can be an effective tool for the next person with your problems. For more details on best practices consider reading the FAQ on asking questions. –  hexafraction Aug 6 '12 at 16:12
    
Also, try asking at Database Administrators. –  hexafraction Aug 6 '12 at 16:13
add comment

1 Answer

up vote 0 down vote accepted

The solution to this is to make a mysqldump and restore from that.

mysqldump -u root -p > iamateapot.sql should save everything in mysql into iamateapot.sql stored in the current working directory.

Transfer that .sql to the other server, do mysql -u root -p < iamateapot.sql, and it'll overwrite all current MySQL data on that server with new data, and retain all users, pws, etc. At least it should.

share|improve this answer
add comment

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.