Hi Chris, I believe you are looking in the wrong place. The my.cnf is used to set startup options for the mysql server or the mysql clients - refering to the client tools that come with the RDBMS.
You want to look into /etc/php.ini or the config.inc.php file from phpmyadmin. Best regards Nils Valentin Tokyo/Japan 2003年 6月 21日 土曜日 05:36、Chris Hutchison さんは書きました: > 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 -- --- Valentin Nils Internet Technology E-Mail: [EMAIL PROTECTED] URL: http://www.knowd.co.jp Personal URL: http://www.knowd.co.jp/staff/nils -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]