rsync mysqldatabase "Permission denied"
Hello,all
when I use rsync to backup mysql data:
[root@localhost local]# ./rsync.sh
rsync: send_files failed to open "/announcer.MYD" (in mysql): Permission denied (13)
rsync: send_files failed to open "/announcer.MYI" (in mysql): Permission denied (13)
rsync: send_files failed to open "/announcer.frm" (in mysql): Permission denied (13)
rsync: send_files failed to open "/announcer_income_detail.MYD" (in mysql): Permission denied (13)
rsync: send_files failed to open "/announcer_income_detail.MYI" (in mysql): Permission denied (13)
rsync: send_files failed to open "/announcer_income_detail.frm" (in mysql): Permission denied (13)
rsync: send_files failed to open "/book_audio.MYD" (in mysql): Permission denied (13)
rsync: send_files failed to open "/book_audio.MYI" (in mysql): Permission denied (13)
rsync error: some files could not be transferred (code 23) at main.c(1298) [generator=2.6.8]
[root@localhost local]# ls -ld /var/lib/mysql/book_audio.MYD
-rw-rw--- 1 mysql mysql 2601408 Jun 17 10:3/var/lib/mysql/book_audio.MYD
When I give others read permission:chmod o+r book_audio.MYD
[root@localhost local]# ls -ld /var/lib/mysql/book_audio.MYD
-rw-rw-r-- 1 mysql mysql 2601408 Jun 17 10:3/var/lib/mysql/book_audio.MYD
Everything is ok! but I don't hope others are readable and I use root to rsync. I don't understand and any other solution?
Thanks very much!
|