Pieter Lategan Posted June 26, 2011 Share Posted June 26, 2011 Hi I have the following error message Warning: mysql_connect () [function.mysql-connect]: Access denied for user 'bp5am' @ 'localhost' (using password: YES) My username and password are as follows; $ connect = mysql_connect ("localhost", "bp5am", "bp5ampass") or die ("Hey, check your server connection."); Link to comment https://forums.phpfreaks.com/topic/240456-warning-mysql_connect-error-message/ Share on other sites More sharing options...
perky416 Posted June 26, 2011 Share Posted June 26, 2011 Hi mate, Im not sure if this will solve your problem but you have a space between the $ and connect that would cause an error. Try using $connect instead of $ connect. Link to comment https://forums.phpfreaks.com/topic/240456-warning-mysql_connect-error-message/#findComment-1235079 Share on other sites More sharing options...
Pieter Lategan Posted June 26, 2011 Author Share Posted June 26, 2011 no that is not true , I dont have any spaces. I think it have to do with my set up of my username and password, I am not sure how to do that maybe you can look at this: $connect = mysql_connect ("localhost", "bp5am", "bp5ampass") or die ("Hey check your server connection."); or maybe my server connection which I dont know how to do that. Link to comment https://forums.phpfreaks.com/topic/240456-warning-mysql_connect-error-message/#findComment-1235084 Share on other sites More sharing options...
perky416 Posted June 26, 2011 Share Posted June 26, 2011 Have you set up the database on your server? Are you using cpanel? Link to comment https://forums.phpfreaks.com/topic/240456-warning-mysql_connect-error-message/#findComment-1235086 Share on other sites More sharing options...
Pieter Lategan Posted June 26, 2011 Author Share Posted June 26, 2011 I dont know How to set up the database on my computer, I do it localy on my pc. Link to comment https://forums.phpfreaks.com/topic/240456-warning-mysql_connect-error-message/#findComment-1235092 Share on other sites More sharing options...
mikesta707 Posted June 26, 2011 Share Posted June 26, 2011 if you dont have a database setup then of course your mysql_connect is going to fail. I don't know what you are using to host php on your local computer, but you should try to google a tutorial on how to set up a database. Link to comment https://forums.phpfreaks.com/topic/240456-warning-mysql_connect-error-message/#findComment-1235097 Share on other sites More sharing options...
Pieter Lategan Posted June 26, 2011 Author Share Posted June 26, 2011 I use XAMPP if that will help. Link to comment https://forums.phpfreaks.com/topic/240456-warning-mysql_connect-error-message/#findComment-1235101 Share on other sites More sharing options...
Pieter Lategan Posted June 27, 2011 Author Share Posted June 27, 2011 Hi The problem is solved, I will create privileges in phpMyAdmin, when I did when the databases worked. Link to comment https://forums.phpfreaks.com/topic/240456-warning-mysql_connect-error-message/#findComment-1235515 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.