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
Share on other sites

Well, since the error message echos your user name correctly and confirms you're using a password, there just isn't a whole lot of wiggle room.  Just for giggles, change your password in SQL and then try it again with the new password.

Link to comment
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?

Link to comment
Share on other sites

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??

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.