Page 1 of 1

BACKUP TABLE - file rights

Posted: Thu Jun 26, 2003 11:12 am
by atu
Hi,

Doing a backup of db tables under mysql using

$sql = '
BACKUP TABLE
test_table
TO
"/backup"
';

give the backup files the rights of the mysql server. I my environement this is:

user: mysql
group: daemon

If the apache isn't a member of the "daemon" group, php can not do some work on this files, ex.: file compression.

Question:
Is this the case, that the mysql and the apache server where members of the same group in most server environements?

Thanks,
Armand

Posted: Thu Jun 26, 2003 2:57 pm
by Stoker
mysql and apache is usually not members of the same group, they really have nothing to do with eachother unless you use mod_mysql for auth or something..

It is fairly simple to give mysql and apache access to /backup, simply add both their users to a group with write rights there.. (Create a new group if you like)

Permission problem

Posted: Fri Jun 27, 2003 5:56 am
by atu
Thanks for your message!
But is it possible to give other file rights from php to the output of this backup methode than those of the mysql server? I want to compress backup tables from within php. But thats not possible because of the permission problem.

$sql = '
BACKUP TABLE
test_table
TO
"/backup"
';

Posted: Fri Jun 27, 2003 7:54 am
by Stoker
if using mod_php, it runs as the user apache runs as, most likely apache can not do chown but you can likely do chmod, that would leave the files readable/writeable to the world..