...

View Full Version : problem to conect to my sqldatabase



cris_300
09-18-2009, 05:21 PM
hi my problem maybe is easy to solved

i try to upload a page with installation include

i define all the varable, change the permitions and delete the install file

but this is the error

Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'xxxxx_cristin'@'localhost' (using password: YES) in /home/igdomco/public_html/todomuebles/Connections/myconn.php on line 9

Fatal error: Access denied for user 'xxxx_cristin'@'localhost' (using password: YES) in /home/igdomco/public_html/todomuebles/Connections/myconn.php on line 9

and my myconn.php is this

<?php
# FileName="Connection_php_mysql.htm"
# Type="MYSQL"
# HTTP="true"
$hostname_myconn = "localhost";
$database_myconn = "xxxxx_casa";
$username_myconn = "xxxx_cristin";
$password_myconn = "xxxxxxx";
$myconn = mysql_connect($hostname_myconn, $username_myconn, $password_myconn) or trigger_error(mysql_error(),E_USER_ERROR);
$map_key = "xxxxxxxxxxxxxxxxxxxxxxx"?>


and the index.php is this


?
//redirect for install
if(!file_exists('Connections/myconn.php'))
header('Location:install.php');

//install file check
if(file_exists('install.php') || file_exists('install2.php') || file_exists('install3.php'))
print '<font color="red"><strong>Please delete install files { install.php , install1.php, install2.php }</strong></font><br>';



//fetch template header
include('header.php');

//define varable
define('go','');
//set index varable for switch statment
if (isset($_REQUEST['go']))
$go = $_REQUEST['go']; // requested page
else
$go = ''; // default

switch($go) {
case 'gmap':
include('gmap.php');
break;
case 'photos':
include('photos.php');
break;
case 'resource_center':
include('resource_center.php');
break;
case 'linkdir':
include('linkdir.php');
break;
case 'mailme':
include('formmail.php');
break;
case 'sell':
include('sell.php');
break;
case 'buy':
include('buy.php');
break;
case 'properties':
include('properties.php');
break;
case 'login' :
echo "<script>window.location='members/login.php'</script>";
break;
case 'register' :
include('register.php');
break;
case 'pricing' :
include('pricing.php');
break;
case 'calc' :
include('calc.php');
break;
case 'contact' :
include('contact.php');
break;
case 'faq' :
include('faq.php');
break;
case 'features' :
include('features.php');
break;
case 'member_login' :
include('member_login.php');
break;
case 'mailme' :
echo"<br><h4>";
include('formmail.php');
echo"</h4>";
break;
case 'detail' :
include('detail.php');
break;
case 'search' :
include('search.php');
break;
default:
include('home.php');
break;
}//end of switch statment


//fetch template footer
include('footer.php');

?>




the version of my hosting is

Version de PHP 5.2.9
Version de MySQL 5.0.77-community

bacterozoid
09-18-2009, 05:38 PM
If you're not on your own computer, you can't use "localhost" as the hostname. Your hosting provider probably has a FAQ or support email that can tell you what to put here.

cris_300
09-18-2009, 07:17 PM
-------------

What is your MySQL hostname?

The MySQL hostname for all our servers is localhost. Setup your PHP scripts to use it for connecting to MySQL.

If you are trying to connect to MySQL from a remote location (from your computer for example), use your hosting account IP address as your MySQL host. Your IP address can by found on the left hand column when you login to cPanel. Do not forget to add your computer IP address to the 'cPanel' -> 'Remote MySQL' section.

-------------

this say my hosting
and i work from there

bacterozoid
09-18-2009, 07:31 PM
Then I stand corrected. You may have tried it, but make sure you verify your password.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum