doforumda Posted November 12, 2009 Share Posted November 12, 2009 hi i have problem using mysql_connect() function. when i use my site on my local computer then it works perfectly but when i upload my site to server then it displays this error Warning: mysql_connect() [function.mysql-pconnect]: Access denied for user 'msaleem'@'localhost' (using password: YES) in /............./portfolio.php on line 26 Warning: mysql_select_db(): supplied argument is not a valid MySQL-Link resource in /......../portfolio.php on line 27 Warning: mysql_query() [function.mysql-query]: Access denied for user 'linuxgr1'@'localhost' (using password: NO) in /.........../portfolio.php on line 29 Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /........./portfolio.php on line 29 i am using localhost in mysql_connect() function. i think this is causing the problem. can anyone tell how can i fix this problem. i mean if this is causing the problem then what should i write instead of localhost? Link to comment https://forums.phpfreaks.com/topic/181230-solved-need-help-in-mysql_connect/ Share on other sites More sharing options...
Mchl Posted November 12, 2009 Share Posted November 12, 2009 Did you set up database username and password on your server? Link to comment https://forums.phpfreaks.com/topic/181230-solved-need-help-in-mysql_connect/#findComment-956061 Share on other sites More sharing options...
doforumda Posted November 12, 2009 Author Share Posted November 12, 2009 Did you set up database username and password on your server? yes i did Link to comment https://forums.phpfreaks.com/topic/181230-solved-need-help-in-mysql_connect/#findComment-956063 Share on other sites More sharing options...
Mchl Posted November 12, 2009 Share Posted November 12, 2009 Are you sure they are correct? Link to comment https://forums.phpfreaks.com/topic/181230-solved-need-help-in-mysql_connect/#findComment-956081 Share on other sites More sharing options...
ThunderLee Posted November 12, 2009 Share Posted November 12, 2009 hi i have problem using mysql_connect() function. when i use my site on my local computer then it works perfectly but when i upload my site to server then it displays this error Warning: mysql_connect() [function.mysql-pconnect]: Access denied for user 'msaleem'@'localhost' (using password: YES) in /............./portfolio.php on line 26 Warning: mysql_select_db(): supplied argument is not a valid MySQL-Link resource in /......../portfolio.php on line 27 Warning: mysql_query() [function.mysql-query]: Access denied for user 'linuxgr1'@'localhost' (using password: NO) in /.........../portfolio.php on line 29 Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /........./portfolio.php on line 29 i am using localhost in mysql_connect() function. i think this is causing the problem. can anyone tell how can i fix this problem. i mean if this is causing the problem then what should i write instead of localhost? Localhost is fine, try posting your code. Link to comment https://forums.phpfreaks.com/topic/181230-solved-need-help-in-mysql_connect/#findComment-956095 Share on other sites More sharing options...
doforumda Posted November 12, 2009 Author Share Posted November 12, 2009 Are you sure they are correct? thanks i was using wrong password. now it is working Link to comment https://forums.phpfreaks.com/topic/181230-solved-need-help-in-mysql_connect/#findComment-956217 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.