Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

can't connect with database during installation


Guest

Recommended Posts

I created this directory

 

shop/oscommerce-2.2rc1/catalog/install

 

I enter my server, password, Id and database [ xxx.mdf ]

 

Error

Can't connect to MySQL server on 'xxxxx.com' (10061)

 

Note: The database is empty - no tables

 

I noticed error 10061 is looking for the local host server.

But I am not installing from the local server

 

I spent two days on this .... I figured I would ask.

 

Thank you in advance

Link to comment
Share on other sites

This problem is basically knowing exactly how your db is named and what the user name is. In some cases it is simple - storedb.sql. In other cases it is hostusername~_storedb.sql or some variation of that. The db user name will follow the same naming convention.

Link to comment
Share on other sites

This problem is basically knowing exactly how your db is named and what the user name is. In some cases it is simple - storedb.sql. In other cases it is hostusername~_storedb.sql or some variation of that. The db user name will follow the same naming convention.
Link to comment
Share on other sites

Thanks for the reply

 

===

I know my user name and password. I don't have problems connecting with my sql hosting server when I use other applications/tools. But for reason I can't get past the Oscommerce installation step.

 

 

"" In some cases it is simple - storedb.sql. In other cases it is hostusername~_storedb.sql or some variation of that. ""

 

I was asking about the database connection not the sql file.

Maybe I didn't understand your response?

 

Peaches

Link to comment
Share on other sites

Ohhh Avec

 

This might be the problem. See I am new to php. The systems I design are asp.net where the connection strings are located in the web.config.

 

I will check this out tonight.

 

Thanks.

Link to comment
Share on other sites

Ok

 

This is what I did

 

I modified the two files

 

* catalog/includes/configure.php

* catalog/admin/includes/configure.php

 

The following changes

 

define('HTTP_SERVER', 'http://xxxxx.com'); // eg, http://localhost or - https://localhost should not be NULL for productive servers

 

 

// define our database connection

define('DB_SERVER', 'sql.sqlserver.com');

define('DB_SERVER_USERNAME', 'username');

define('DB_SERVER_PASSWORD', 'password');

define('DB_DATABASE', 'database');

define('USE_PCONNECT', 'false');

define('STORE_SESSIONS', '');

?>

 

For the installation page I just entered the above parameters.

No prefixes

 

I am still receiving the connection error during the installation process.

 

Thanks in advance

Link to comment
Share on other sites

Your service provider would have provided you with URL to connect to database.

Can you replace define http_server with recommended URL string (eg. in my case i have to use username.hostname.com for database...

 

Thx,

Best Regards,
Gaurav

Link to comment
Share on other sites

Correction, I intend to say configure.php and not database.php.

and http_server setting should have no bearing on this problem, but DB_SERVER is where your settings need to be correct for database connection.

From my host -- i have to use following setting.

define('DB_SERVER', 'sql2.xxxxxx.com'); // eg, localhost - should not be empty for productive servers

 

Regards,

Best Regards,
Gaurav

Link to comment
Share on other sites

Yes, I checked both configure.php file .

 

define('HTTP_SERVER', 'http://www.xxxxx.com'); // eg, http://localhost or - https://localhost should not be NULL for productive servers

 

 

// define our database connection

define('DB_SERVER', 'sql.sqlserver.com');

define('DB_SERVER_USERNAME', 'username');

define('DB_SERVER_PASSWORD', 'password');

define('DB_DATABASE', 'database');

define('USE_PCONNECT', 'false');

define('STORE_SESSIONS', '');

=================

 

Hmmm, not sure what to do now.

I am able to connect with the database using the Microsoft SQL Server Management Studio Express.

Link to comment
Share on other sites

Create a new file and run it.

Let me know what you get. You can save it by any name in /root folder and have to add details relevant to your site.

<?php 

echo "Server is : ".$_SERVER['SERVER_NAME'];	 


function connect($sql) 
{ 

$username	 = "xxxxxxx"; 
$pwd		  = "xxxxxxxx"; 
$host		 = "xxxxxxx"; 
$dbname	   = "xxxxxxxxxxx"; 


if (!($conn=mysql_connect($host, $username, $pwd)))  { 
   printf("error connecting to DB by user = $username and pwd=$pwd"); 
   exit; 
} 
$db=mysql_select_db($dbname,$conn) or die("Unable to connect to database1"); 

$result = mysql_query($sql, $conn)or die("Unable to query local database <b>". mysql_error()."</b><br>$sql"); 
if (!$result){ 
	echo "database query failed."; 
}else{ 
	return $result; 
}//end if 
}//end function 
?>

<?php 
echo "Step 1";
$sql = "select * from TABLE_ORDERS_STATUS"; 
echo "Step 2";
$result = connect($sql); 
echo "Step 3";
if ($result){ 
  echo "This is working .. rest all should work as well";
}//end if 
?>

 

Cheers,

Best Regards,
Gaurav

Link to comment
Share on other sites

Hello

 

Thank you Gary for trying to assist. Before I run the test

 

Hmmmm question

 

My database is MS SQL .... the Oscommerce database is MySQL

 

I am thinking this is the issue?

 

I did noticed when I tried to run the oscommerce script there were errors ..... that is when I was like hmmmmmm this might be the issue

 

Do I need to install a Mysql plugin?

 

Regards,

Peaches ~

Link to comment
Share on other sites

I am confused about installation process... when you installed osc - did the script prompt (and test) for database connectivity?

 

Have you installed osc - or just copied the file structure (without database installation) ...

please elaborate, since install doesn't proceed until database connectivity is tested (and optionally data populated)

 

Cheeers,

Best Regards,
Gaurav

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...