Jump to content

trouble with mysql_connect!


crrazyjane

Recommended Posts

Ok guys - I'm officially stumped. Here's the code in question:

 

 

$username="thering_thering";

$password="******";

$database="thering_slotdata";

mysql_connect("localhost", $username, $password) or die(mysql_error());

mysql_select_db("thering_slotdata") or die(mysql_error());

$query="SELECT * FROM slotinfo WHERE promoEndDate>='".$date."' ORDER BY promoStartDate LIMIT 1";

$result = mysql_query($query);

 

mysql_close();

 

 

And here's what I'm getting:

 

 

Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'thering_thering'@'localhost' (using password: YES) in C:\xampplite\htdocs\playersring\inc\ring-season-function.php on line 10

Access denied for user 'thering_thering'@'localhost' (using password: YES)

 

 

I've triple-checked my username and password. This is happening both on my virtual server (xampp lite) and on the live site. Everything works FINE if I do not use a password - ie, connecting through the "root" user with no password. I even tried adding a password to the root user, just for kicks, and as soon as I did - same error. I've set the permissions for this user to absolutely freaking everything allowed, just in case it was a permissions problem - still no go.

 

I've googled this up the ying-yang and the only advice I'm seeing is "double check your username and password" - but I HAVE. A LOT. Does anyone have any idea what else could be causing this error??

Link to comment
https://forums.phpfreaks.com/topic/203881-trouble-with-mysql_connect/
Share on other sites

Okay - I'm getting closer now - I tried looking at what privileges my thering_thering user had - and nothing came up. Poked around a bit further, went into myphpAdmin, and saw that the user doesn't have privileges for any databases as of yet. I tried to add one - and I got the following error:

 

#1133 - Can't find any matching row in the user table

 

I went back over to the user table in the mysql database - and thering_thering is most certainly showing up there. I'm thinking this is probably the root of my mysql_connect problem. Any idea what this error means?

Sorry - let me be a little clearer. The user thering_thering is showing up everywhere it's supposed to in phpMyAdmin - I can see it in my user table in the mysql database. It is showing up as having privileges for all the databases I want it to have privileges for. The problem is happening when I try to run a grant statement - it acts as though the user does not exist.

 

This is definitely starting to look like a mysql problem rather than a php one - should I move this over to the mysql forum??

this information seems OK.....

 

btw, screendump should give same information as:

select * from information_schema.user_privileges where GRANTEE LIKE '%thering_thering%';

 

i think the quicked solution might be:

DROP USER thering_thering;

and afterward re-create this user.....

 

byt maybe someone else has a better solution?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.