Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Connection problems

Status
Not open for further replies.

sirugo

Programmer
Aug 1, 2000
162
SE
I'm a newbie to MySQL but everything works fine until I start experimenting with privileges.
Trying to follw the manual instructions, doing this:

1. Creating database, tables and columns.
2. GRANTing a user called subadmin with SELECT privilege only.
3. I look at the mysql -> db table and the user is there with the right privilege.
4. I look at the mysql -> user table and there is an encrypted password for the entered password "diss".
5. I try to send the following through PHP:

@ $db = mysql_pconnect("localhost", "subadmin", "diss");

if (!$db)
{
printf( "%s", mysql_error($msl) );
exit;
}

6. I get the message:
"Access denied for user: 'subadmin@localhost' (Using password: YES) in........"

Where's my bug?
Thanks
P
 
OK, I found the problem:

When GRANTing I forgot to add @localhost after the username:

GRANT SELECT on dbse.* to subadmin@localhost IDENTIFIED BY 'diss'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top