Jump to content

mysql_connect error when using password


crrazyjane

Recommended Posts

Okay - this one is driving me nuts. I've been using the root user without a password while I've had this site in development, but am now getting ready to go live, so I've created a user with a password with permissions for this database. Except now mysql_connect is throwing an error. Here's the code:

 

<?php

 

 

// define current date variables

$date = date ("Y-m-d");

 

mysql_connect("localhost", "thering_thering", "*****") 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);

 

blah, blah  - other stuff I know works fine.

 

I'm getting the following error:

 

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

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

 

Line 40, of course, being the line where my mysql_connect statement is located.

 

I have triple-checked that I have entered my username and password correctly. I gave this user COMPLETE privileges. Just for kicks, I even tried going back to the root user - but as soon as I added a password, I got the same error. Works fine without a password. Throws a tantrum with one.

 

Anyone have a freaking clue what else I can look at, here??

 

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.