Jump to content

Warning: mysql_connect() [function.mysql-connect]: Unknown MySQL server host 'Handcraftdesigns' (0)/admin/includes/


Go to solution Solved by bstafford,

Recommended Posts

Hello,

 

Looking for help to solve this problem I have as this is new to me and now starting to learn.

When I type in my website name,  handcraftdesigns.co.uk I receive this error warning message.

 

Warning: mysql_connect() [function.mysql-connect]: Unknown MySQL server host 'Handcraftdesigns' (0) in /home/content/26/10616326/html/admin/includes/functions/database.php on line 19
Unable to connect to database server!

 

I understand that I don't have the correct location names in my file, it is because I don't know how to properly type in the correct names needed, so looking for example of correct method. I am using OsCommerce 2.3.3 and have uploaded all my files via Filezilla and using Adobe DS3 to modify my files.

 

Here is the file content of what I attempted, but have something incorrect here:

 

 

<?php
/*
  $Id$

  osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com

  Copyright © 2007 osCommerce

  Released under the GNU General Public License
*/

  function tep_db_connect($server = DB_SERVER, $username = DB_SERVER_USERNAME, $password = DB_SERVER_PASSWORD, $database = DB_DATABASE, $link = 'db_link') {
    global $$link;

    if (USE_PCONNECT == 'true') {
      $$link = mysql_pconnect("Handcraftdesigns.db.10616326.hostedresource.com", "Handcraftdesigns", "Password");
    } else {
      $$link = mysql_connect("Handcraftdesigns.db.10616326.hostedresource.com", "Handcraftdesigns", "Password");
    }

    if ($$link) mysql_select_db("Handcraftdesigns");

    return $$link;
  }

  function tep_db_close($link = 'db_link') {
    global $$link;

    return mysql_close($$link);
  }

 

Can someone please help me and explain what I have typed in wrong here to get the error, thanks

Is your database server remote from your web server? On most hosts, the database server can be reached through the localhost.  If you aren't sure if the database server is remote, then try using 'localhost' as the server name.

  • Solution

@jcbones

 

Hi, thanks for the reply on that, I am not sure if remote server or not, but I use GoDaddy dedicated Linux server and then uploaded all my files to that, I believe this is the way it is set up.  I have replaced the name I had with "localhost" and still no access, but get these errors below.

 

Warning: session_start() [function.session-start]: open(D:/Hosting/10616326/html/includes/work//sess_6g426fa1slc07sfv2cbd2ojha5, O_RDWR) failed: No such file or directory (2) in /home/content/26/10616326/html/admin/includes/functions/sessions.php on line 102

Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/content/26/10616326/html/admin/includes/functions/sessions.php:102) in /home/content/26/10616326/html/admin/includes/functions/sessions.php on line 102

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/content/26/10616326/html/admin/includes/functions/sessions.php:102) in /home/content/26/10616326/html/admin/includes/functions/sessions.php on line 102

Warning: Cannot modify header information - headers already sent by (output started at /home/content/26/10616326/html/admin/includes/functions/sessions.php:102) in /home/content/26/10616326/html/admin/includes/functions/general.php on line 34

Warning: Unknown: open(D:/Hosting/10616326/html/includes/work//sess_6g426fa1slc07sfv2cbd2ojha5, O_RDWR) failed: No such file or directory (2) in Unknown on line 0

Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (D:/Hosting/10616326/html/includes/work/) in Unknown on line 0

 

Thanks for the help, hoping to get into to this the rest of weekend and start adding product.

@ jcbones,

 

This is what is in the database.php file now.

 

 

function tep_db_connect($server = DB_SERVER, $username = DB_SERVER_USERNAME, $password = DB_SERVER_PASSWORD, $database = DB_DATABASE, $link = 'db_link') {
    global $$link;

    if (USE_PCONNECT == 'true') {
      $$link = mysql_pconnect("localhost", "passord");
    } else {
      $$link = mysql_connect(""localhost", "password");
    }

    if ($$link) mysql_select_db("Handcraftdesigns");

    return $$link;
  }

  function tep_db_close($link = 'db_link') {
    global $$link;

    return mysql_close($$link);
  }
 

Godaddy always uses remote database connections (I hate godaddy, and this is one of the many reasons).  So, assuming that you have created the database (and waited the hour or two that it needs to be active), log in to your control panel, go to databases, then actions, then details.  Your hostname should be there, and that is what you should have for your DB_SERVER constant.  You then need to change your file back to what it was originally, and put your changes wherever your constants are defined.

@bstafford,
 
I'm with Go Daddy and came across your post.
 
@jcbones is correct in that you will need to create the database, then go into your control panel to locate the hostname.
 
More information on locating the host name can be found here:
 
http://support.godaddy.com/help/article/39/locating-your-databases-host-name
 
If you are still running into any issues please feel free to reply or send me a private message with any additional details.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.