note 33766 added to function.mysql-connect
| From: | David at rack1 dot php dot net | Date: | Mon, 07 Jul 2003 10:34:27 +0000 |
| Subject: | note 33766 added to function.mysql-connect | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-51617@lists.php.net to get a copy of this message | ||
>A better way to protect your password/data with PHP and
>MySQL, if you don't need write access, is to have a new
>user, such as "nobody" (which is often the default Apache
>user processing your PHP anyway) who has read-only access
>to your database tables--and connect using nobody and no
>password.
Only do this if you don't have confidential data in the database. Any user with access to the
db server will have access to your data, i'd still use a password just as another level of
protection anyway.
>Another note: Say you want your script to write some files
>to one of your directories, but you don't want the directory
>world-writable. Simply make the directory's group "nobody"
>and chmod it 775. This way, "nobody" will have rw access,
>but nobody else.
If im thinking correctly, this is good as long as someone on the server doesn't write a php
script running it on the same webserver to read the files you've just 'protected'.
----
Manual Page -- http://www.php.net/manual/en/function.mysql-connect.php
Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+33766
Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+33766&report=yes
Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+33766&report=yes