bugzy Posted January 17, 2011 Share Posted January 17, 2011 Hello! I'm just a beginner. I'm now practicing on connecting to a database here on my local machine but I'm having this error. Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'user1'@'localhost' (using password: NO) in C:\wamp\www\mysamp\database.php on line 17 Cannot connect to the database! :Access denied for user 'user1'@'localhost' (using password: NO) I'm using MySql 5.1.36 and phpMyAdmin 3.2.0.1 TIA! Any idea what seemed to be the problem? Link to comment https://forums.phpfreaks.com/topic/224735-beginner-help-on-phpmyadmin-mysql-error-no-password/ Share on other sites More sharing options...
Maq Posted January 17, 2011 Share Posted January 17, 2011 Your credentials are wrong. Are you sure you don't have a password? Link to comment https://forums.phpfreaks.com/topic/224735-beginner-help-on-phpmyadmin-mysql-error-no-password/#findComment-1160829 Share on other sites More sharing options...
Muddy_Funster Posted January 17, 2011 Share Posted January 17, 2011 can we get a look at your connection string please? Link to comment https://forums.phpfreaks.com/topic/224735-beginner-help-on-phpmyadmin-mysql-error-no-password/#findComment-1160834 Share on other sites More sharing options...
bugzy Posted January 17, 2011 Author Share Posted January 17, 2011 can we get a look at your connection string please? Here <?php $user = "user1"; $password = "password1"; $connect = mysql_connect('localhost',$user,$passord) or die("Cannot connect to the database! :". mysql_error()); echo "We connected successfuly to the Database!"; echo "<br/><br/>"; ?> What do you think? Link to comment https://forums.phpfreaks.com/topic/224735-beginner-help-on-phpmyadmin-mysql-error-no-password/#findComment-1160836 Share on other sites More sharing options...
Maq Posted January 17, 2011 Share Posted January 17, 2011 You need to add your password as the third parameter in the mysql_connect method. Link to comment https://forums.phpfreaks.com/topic/224735-beginner-help-on-phpmyadmin-mysql-error-no-password/#findComment-1160838 Share on other sites More sharing options...
bugzy Posted January 17, 2011 Author Share Posted January 17, 2011 You need to add your password as the third parameter in the mysql_connect method. Maq I'm not sure if I got what you're talking about.. But it's already there... notice the $password variable? Link to comment https://forums.phpfreaks.com/topic/224735-beginner-help-on-phpmyadmin-mysql-error-no-password/#findComment-1160840 Share on other sites More sharing options...
bugzy Posted January 17, 2011 Author Share Posted January 17, 2011 I already solved it guys. Error is on my 3rd parameter. I misspelled the variable. Thanks for those who help me! Link to comment https://forums.phpfreaks.com/topic/224735-beginner-help-on-phpmyadmin-mysql-error-no-password/#findComment-1160846 Share on other sites More sharing options...
Maq Posted January 17, 2011 Share Posted January 17, 2011 I already solved it guys. Error is on my 3rd parameter. I misspelled the variable. Thanks for those who help me! Sorry, I thought that was one variable. Glad you solved it. Link to comment https://forums.phpfreaks.com/topic/224735-beginner-help-on-phpmyadmin-mysql-error-no-password/#findComment-1160851 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.