farban6 Posted November 10, 2011 Share Posted November 10, 2011 Having a major problem connecting to a live site. I have set up the user and database on Cpanel like normal. Then proceeded to insert those details into my mysql connection script <?php $db_link = mysql_connect("***","****","***"); if (!$db_link) { die('Could not connect: ' . mysql_error()); } $db_selected = mysql_select_db('amenshar_calender', $db_link); if (!$db_selected) { die ('Can\'t use database : ' . mysql_error()); } ?> I am connecting to domain erban.co.uk, yet looking at the cpanel the master domain is amensharma.co.uk. Is this what the problem could be. This is the error messege it is throwing up Warning: mysql_connect(): Access denied for user '_admin'@'localhost' (using password: YES) in d:\Domains\erban.co.uk\wwwroot\functions\database.php on line 4 Could not connect: Access denied for user '_admin'@'localhost' (using password: YES) Quote Link to comment https://forums.phpfreaks.com/topic/250890-stumpted-when-connecting-to-database-on-live-site/ Share on other sites More sharing options...
xyph Posted November 10, 2011 Share Posted November 10, 2011 Nice password you have there. Odd that you have 'amenshar_admin' entered in to the database, yet the error is saying Access denied for user '_admin' Quote Link to comment https://forums.phpfreaks.com/topic/250890-stumpted-when-connecting-to-database-on-live-site/#findComment-1287156 Share on other sites More sharing options...
farban6 Posted November 10, 2011 Author Share Posted November 10, 2011 Sorry my mistake. Warning: mysql_connect(): Access denied for user 'amenshar_admin'@'www2' (using password: YES) in d:\Domains\erban.co.uk\wwwroot\functions\database.php on line 4 Could not connect: Access denied for user 'amenshar_admin'@'www2' (using password: YES) Yeah its still in the middle of testing Is there anything details needed to help solve this problem? Quote Link to comment https://forums.phpfreaks.com/topic/250890-stumpted-when-connecting-to-database-on-live-site/#findComment-1287164 Share on other sites More sharing options...
xyph Posted November 10, 2011 Share Posted November 10, 2011 Yeah, you need to specify the right information. Ask your host. 'www2' is probably not a valid host. Quote Link to comment https://forums.phpfreaks.com/topic/250890-stumpted-when-connecting-to-database-on-live-site/#findComment-1287166 Share on other sites More sharing options...
farban6 Posted November 10, 2011 Author Share Posted November 10, 2011 Good spot, just noticed the site technically isnt on www2.erban.co.uk as its on www.erban.co.uk. Is there a way of making it so the server reads www rather then www2, any explanations on why this is happening? Thanks for any additional information Quote Link to comment https://forums.phpfreaks.com/topic/250890-stumpted-when-connecting-to-database-on-live-site/#findComment-1287169 Share on other sites More sharing options...
xyph Posted November 10, 2011 Share Posted November 10, 2011 Your host will provide you with this information Quote Link to comment https://forums.phpfreaks.com/topic/250890-stumpted-when-connecting-to-database-on-live-site/#findComment-1287171 Share on other sites More sharing options...
farban6 Posted November 10, 2011 Author Share Posted November 10, 2011 Okay thanks i'm going to get in touch with the host then and try and sort this out. Thanks for everyones help! Quote Link to comment https://forums.phpfreaks.com/topic/250890-stumpted-when-connecting-to-database-on-live-site/#findComment-1287173 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.