Need some help on security with php and mysql
| From: | hamish | Date: | Thu, 28 Mar 2002 10:37:28 +0000 |
| Subject: | Need some help on security with php and mysql | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-90500@lists.php.net to get a copy of this message | ||
Hello all,
I am using php and mysql with phpmyadmin. I am trying to set up a username and password in mysql so that when I use
if(!$db_conn = mysql_connect('localhost', 'username', "password")) {
echo 'Could not connect to the Database Server';
}
with the correct username and password it will connect me. I used phpmyadmin to add the user to the users table in the mysql database. I used the following sql statement:
INSERT INTO user (Host,User,Password) VALUES('localhost','jeffrey',PASSWORD('biscuit'));
and the record was created in the table.
When I try to connect to the db via the php
if(!$db_conn = mysql_connect('localhost', 'jeffrey', "biscuit")) {
echo 'Could not connect to the Database Server';
}
it tells me:
Warning: Access denied for user: 'jeffrey@localhost' (Using password: YES) in /home/httpd/htdocs/helpdesk/test.php
What have I done wrong?
cheers
Hamish