Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Unable to connect to database server!


Plain Jane

Recommended Posts

Posted

I am working on an osCommerce site on my localhost server. After transferring the files to my web server I get the follwoing error: Unable to connect to database server!

 

I am using "localhost" as the DB server and have confirmed with my hosting company that this is the correct database server name. I have also confirmed that username and password are correct. I've updated all the other server variables as well. here is a copy of my admin/includes/configure.php file:

 

<?php

define('HTTP_SERVER', 'localhost');

define('HTTPS_SERVER', 'localhost');

define('HTTP_CATALOG_SERVER', 'localhost');

define('HTTPS_CATALOG_SERVER', 'localhost');

define('ENABLE_SSL_CATALOG', 'true');

define('ENABLE_SSL', 'true');

define('DIR_FS_DOCUMENT_ROOT', '/www/test/');

define('DIR_WS_ADMIN', '/admin/');

define('DIR_FS_ADMIN', '/www/test/');

define('DIR_WS_CATALOG', '/');

define('DIR_FS_CATALOG', '/www/test/');

define('DIR_WS_IMAGES', 'images/');

define('DIR_WS_ICONS', DIR_WS_IMAGES . 'icons/');

define('DIR_WS_CATALOG_IMAGES', DIR_WS_CATALOG . 'images/');

define('DIR_WS_INCLUDES', 'includes/');

define('DIR_WS_BOXES', DIR_WS_INCLUDES . 'boxes/');

define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES . 'functions/');

define('DIR_WS_CLASSES', DIR_WS_INCLUDES . 'classes/');

define('DIR_WS_MODULES', DIR_WS_INCLUDES . 'modules/');

define('DIR_WS_LANGUAGES', DIR_WS_INCLUDES . 'languages/');

define('DIR_WS_CATALOG_LANGUAGES', DIR_WS_CATALOG . 'includes/languages/');

define('DIR_FS_CATALOG_LANGUAGES', DIR_FS_CATALOG . 'includes/languages/');

define('DIR_FS_CATALOG_IMAGES', DIR_FS_CATALOG . 'images/');

define('DIR_FS_CATALOG_MODULES', DIR_FS_CATALOG . 'includes/modules/');

define('DIR_FS_BACKUP', DIR_FS_ADMIN . 'backups/');

 

define('DB_SERVER', 'localhost');

define('DB_SERVER_USERNAME', '[username censored]');

define('DB_SERVER_PASSWORD', "[password censored]");

define('DB_DATABASE', '[database censored]');

define('USE_PCONNECT', 'false');

define('STORE_SESSIONS', 'mysql');

 

define('CATEGORY_FOLDER', 'category/');

define('PRODUCT_FOLDER', 'product/');

define('ORIGINAL_FOLDER', 'original/');

define('LARGE_FOLDER', 'large/');

define('MEDIUM_FOLDER', 'medium/');

 

I've also tried replacing localhost with the www.mydomainname.com Any ideas on why I can't connect?

define('SMALL_FOLDER', 'small/');

 

define('CIRCLE_FOLDER', 'circle/');

 

define('SMALL_IMAGE_WIDTH', '105');

define('SMALL_IMAGE_HEIGHT', '160');

define('MEDIUM_IMAGE_WIDTH', '264');

define('MEDIUM_IMAGE_HEIGHT', '400');

?>

Posted

can i ask something "stupid"? i have the Apache web server to my pc...i made a new empty database...then i put the parameters to step 1 of oscommerce installation,for database server without any luck...the question is this..my web provider must give me the username and password or those i put to create the database are correct?

Posted

can i ask something "stupid"? i have the Apache web server to my pc...i made a new empty database...then i put the parameters to step 1 of oscommerce installation,for database server without any luck...the question is this..my web provider must give me the username and password or those i put to create the database are correct?

 

Firstly it's not being stupid, it's just a case of not knowing.

 

The database access credentials will be those you used to set up the database server on your local pc . . perhaps "root" and a password.

Posted

root and a password are the parameters i used for the database,and those i put to oscommerce,but when i press continue it starts a "testing database connection" but never stops...so i can't go to step 2 installation of osc...

Posted

can i ask something "stupid"? i have the Apache web server to my pc...i made a new empty database...then i put the parameters to step 1 of oscommerce installation,for database server without any luck...the question is this..my web provider must give me the username and password or those i put to create the database are correct?

 

Put your 'root'@127.0.0.0 username and psw. Make sure your sql server is ok.

Posted

I can't understand.....i'm doing all things right but nothing.my sql server is ok.i see that current user in sql server is "root@localhost"...i've tried it with no change..."Testing database connection" still running...

Posted

I can't understand.....i'm doing all things right but nothing.my sql server is ok.i see that current user in sql server is "root@localhost"...i've tried it with no change..."Testing database connection" still running...

 

Then it must be PHP settings .. check that register_long_arrays is set to on

Posted

The register_long_arrays was off and i turned it to on but still nothing...i am going to try all from the beggining...in case that i have done something wrong..

Posted

I did a fix on this.Go to your cpanel ---File manager get into your public_html (what ever site your having trouble with) Go to includes-config.php

define (datebase) what ever your database is type in name example--= username_database--->input what is needed and then it will find your database.

Thats what worked for me.Hope this helps.

Archived

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

×
×
  • Create New...