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
https://forums.phpfreaks.com/topic/203102-mysql_connect-error-when-using-password/
Share on other sites

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.