Jump to content

Stumpted when connecting to database on live site


farban6

Recommended Posts

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)

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 :P

 

Is there anything details needed to help solve this problem?

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.