Win XP Pro, IIS, MySQL PHP 5.
I create a file from mySQL with ...SELECT ...INTO OUTFILE. Subsequently, I cannot delete it with unlink(). I get Warning: unlink(db_backup/temp.txt): Permission denied in D:\Coding\Web\CC\include\functions.php
Fileperms() on the file return 100666, and the file is reported as is_readable but not is_writable nor is_executable. Permission is also denied for chmod().
I can copy the file, and delete the copied file. The copied file has the same fileperms() and same combination of readable/writable/executable.
Where should I be looking, please?
Problem with mySQL/PHP permissions
Moderator: General Moderators
- akuji36
- Forum Contributor
- Posts: 190
- Joined: Tue Oct 14, 2008 9:53 am
- Location: Hartford, Connecticut
Re: Problem with mySQL/PHP permissions
I believe you be looking at mysql db ---- it has a privilege table.
Look into granting privileges to users and db.
see link below:
http://www.devshed.com/c/a/PHP/Doing-Mo ... -Part-1/5/
I use myphpadmin. Easier to control mysql
Look into granting privileges to users and db.
see link below:
http://www.devshed.com/c/a/PHP/Doing-Mo ... -Part-1/5/
I use myphpadmin. Easier to control mysql
Re: Problem with mySQL/PHP permissions
http://dev.mysql.com/doc/refman/5.0/en/select.html
Note
Any file created by INTO OUTFILE or INTO DUMPFILE is writable by all users on the server host. The reason for this is that the MySQL server cannot create a file that is owned by anyone other than the user under whose account it is running. (You should never run mysqld as root for this and other reasons.) The file thus must be world-writable so that you can manipulate its contents.
If the secure_file_priv system variable is set to a nonempty directory name, the file to be written must be located in that directory.
There are 10 types of people in this world, those who understand binary and those who don't