crrazyjane Posted May 27, 2010 Share Posted May 27, 2010 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 More sharing options...
jdavidbakr Posted May 27, 2010 Share Posted May 27, 2010 Make sure you user is thering_thering@localhost and not thering_thering@% Link to comment https://forums.phpfreaks.com/topic/203102-mysql_connect-error-when-using-password/#findComment-1064336 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.