Password in connection string
| From: | Ron Rudman | Date: | Mon, 12 May 2003 00:37:43 +0000 |
| Subject: | Password in connection string | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-147240@lists.php.net to get a copy of this message | ||
I'm using PEAR and a MySQL database. My connection string contains
<user>:<password> and works fine. But I don't like having passwords in
clear text. Is there any way for me to not have to code the password but
instead let MySQL find it in a my.cnf file?
I've tried with <user>=mysql, which is the owner of mysqld, and I've put the
password in the [client] section of mysql's home directory. What's
happening is that by omitting the password in the connection string, the
connection is attempted with "using password=NO". This is unlike the
behavior of other clients for mysql.
Is there any way to do this?
BTW, I've found one "solution" to be: put the setting of the connection
string, which is a $_SESSION variable, in a file that's not in the document
root, then REQUIRE that file.