BACKUP TABLE - file rights

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
atu
Forum Newbie
Posts: 3
Joined: Sat Jun 21, 2003 10:45 am
Location: Luxembourg

BACKUP TABLE - file rights

Post 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
User avatar
Stoker
Forum Regular
Posts: 782
Joined: Thu Jan 23, 2003 9:45 pm
Location: SWNY
Contact:

Post 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)
atu
Forum Newbie
Posts: 3
Joined: Sat Jun 21, 2003 10:45 am
Location: Luxembourg

Permission problem

Post 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"
';
User avatar
Stoker
Forum Regular
Posts: 782
Joined: Thu Jan 23, 2003 9:45 pm
Location: SWNY
Contact:

Post 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..
Post Reply