PDA

View Full Version : localhost to live?


Antony
04-06-2010, 08:19 PM
Ive been building a site with a login database. Up until now Ive only tested it on my PC. The login works ok locally. My problem is that when I transfere the files to the hostsite and test it Im getting the following error:
Warning: mysql_pconnect() [function.mysql-pconnect (http://www.petes-books.co.uk/paranormal_activity/function.mysql-pconnect)]: Access denied for user 'root'@'localhost' (using password: NO) in ......./Connections/login.php on line 9

Fatal error: Access denied for user 'root'@'localhost' (using password: NO) in ....../Connections/login.php on line 9

The following is the code for the relevant file:

<?php
# FileName="Connection_php_mysql.htm"
# Type="MYSQL"
# HTTP="true"
$hostname_login = "localhost";
$database_login = "login";
$username_login = "root";
$password_login = "";
$login = mysql_pconnect($hostname_login, $username_login, $password_login) or trigger_error(mysql_error(),E_USER_ERROR);
?>

Now I understand that I need to change the username and password to the admin username/password for the database that is on the hosting area but do I leave the "$hostname_login" as "localhost" or change it? or do I change the "$database_login = "login" "? Or both? My presumption is to change "$database_login = "login" only.

davidj
04-06-2010, 09:22 PM
You normally just need to change your username and password

Antony
04-07-2010, 07:07 AM
thanks Davidj

davidj
04-07-2010, 09:45 AM
Are you using the

mysql_select_db($dbname);In your script

Antony
04-09-2010, 08:52 AM
Let me check on that. I was using the automated scripts given in the insert server behaviour panel.

Antony
04-09-2010, 08:53 AM
BTW meant to mention. Its working just as I want it now. Thanks