Hello all,

I'm pretty new to MySQL, but have managed to create a database that is
accessed via PHP which then creates tables from the MySQL data.

Currently, I am using the root user/password combo to grab the info (which
means the password is plaintext in the PHP).   I wanted to use the my.cnf to
define the password, but no matter where I put the file (/etc/my.cnf,
/var/lib/mysql/, /var/lib/mysql/[databasename], /root, /home/mysql/.my.cnf)
my query won't seem to hit the my.cnf file which has the following in it:
(note:  it doesn't have a username defined.)

[client]
password=mypassword

my database is called 'assets' and it's located in:
/var/lib/mysql/assets

I have a mysql user defined:
mysql:x:100:101:MySQL server:/var/lib/mysql:/bin/bash

The php stuff is located in a single directory:
/var/www/html/assets

Yet when I try to access the page (which works when the password is passed
in the php), I get:

Warning: Access denied for user: '[EMAIL PROTECTED]' (Using password: NO) in
/var/www/html/assets/fetch-new.php on line 6

Warning: MySQL Connection Failed: Access denied for user: '[EMAIL PROTECTED]'
(Using password: NO) in /var/www/html/assets/fetch-new.php on line 6

fetch-new.php's line 6 (and 7) looks like this:

$db = mysql_connect("localhost", "root");
mysql_select_db("assets",$db);


I've checked out the mysql.com's documentation, and I've tried putting the
my.cnf file in every place they reference, but it doesn't seem to work via
this PHP.   When I connect from the command line (on the Linux box), it
*does* work, so it seems that the /etc/my.cnf file is being checked at that
point, but isn't being checked in the php.

Does anyone see/know a fix?   I'm out of ideas.

Thanks in advance,

Chris


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to