Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Sep 2009
    Posts
    5
    Thanks
    3
    Thanked 0 Times in 0 Posts

    problem to conect to my sqldatabase

    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
    Code:
     <?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

    Code:
    ? 
    //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
    Last edited by cris_300; 09-18-2009 at 04:38 PM.

  • #2
    Regular Coder bacterozoid's Avatar
    Join Date
    Jun 2002
    Location
    USA
    Posts
    490
    Thanks
    24
    Thanked 35 Times in 35 Posts
    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.

  • Users who have thanked bacterozoid for this post:

    cris_300 (09-30-2009)

  • #3
    New to the CF scene
    Join Date
    Sep 2009
    Posts
    5
    Thanks
    3
    Thanked 0 Times in 0 Posts
    -------------

    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

  • #4
    Regular Coder bacterozoid's Avatar
    Join Date
    Jun 2002
    Location
    USA
    Posts
    490
    Thanks
    24
    Thanked 35 Times in 35 Posts
    Then I stand corrected. You may have tried it, but make sure you verify your password.

  • Users who have thanked bacterozoid for this post:

    cris_300 (09-30-2009)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •