Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Sudden Error For Catalog Main Page


Guest

Recommended Posts

Hi - For some reason, today I have started getting the following error when I call my catalog, which is at www.patchoguerecords.com/catalog (i HAVE REmoved my full server path):

 

Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'nobody'@'localhost' (using password: NO) in .../catalog/includes/functions/database.php on line 19

Unable to connect to database server!

 

What on earth is going on, and how can I fix this - any ideas? >_<

Link to comment
Share on other sites

Hi - For some reason, today I have started getting the following error when I call my catalog, which is at www.patchoguerecords.com/catalog (i HAVE REmoved my full server path):

 

Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'nobody'@'localhost' (using password: NO) in .../catalog/includes/functions/database.php on line 19

Unable to connect to database server!

 

What on earth is going on, and how can I fix this - any ideas? >_<

 

This is usually caused by an error in the configure.php file.

 

It cois probably a username, password, or dbname problem.

Just between us, remember there are only 10 kinds of people in the world; those who understand binary and those who don't!!

 

Remember, learning is a "do-it-yourself" experience; although, not necessarily a "do-it-BY-yourself" experience.

 

The quickest way to learn is to forget to BACKUP!

Link to comment
Share on other sites

This is usually caused by an error in the configure.php file.

 

It cois probably a username, password, or dbname problem.

 

thanks, Ralph - can you or any other user suggest what parts of the configure file I should look at or what might be wrong? I am not a scripter and unfortunately require a small amount of handholding...

 

I also don't understand why user and password have anything to do with that entry screen page - since they should be public anyhow - I'm afraid of massively messing up the code. I think I haven't removed the config file yet (whatever it was called) from the server as they suggest you do so perhaps I could just call it through the browser - will do that and see what it looks like, in case...

 

Thanks again, and I'll check back here.

Hannah

Link to comment
Share on other sites

(search terms: home page of store doesn't show shows error message store entrance messed up displays error shop front not working catalog not working can't call catalog main page)

 

FIXED IT. We guessed our way through editing the database.php file - for anyone in future with same problem, not sure why it suddenly stopped functioning (our problem was: entry page of catalog not calling/displaying error message shown in top post), BUT the error message was in part misleading for anyone who's not a programmer, because it references line 19...

IN FACT, the problem was a few lines up, where for some reason the database and user and server were not defined - so this is how it is, having retyped the areas indicated to reflect our settings (and they are in lowercase exactly as they appear in our database/server):

 

 

function tep_db_connect($server = localhost, $username = HAD_TO_REFILL_USERNAME_HERE, $password = ANDPASSWORDHERE, $database = AND_DATABASE_NAME_HERE, $link = 'db_link') {

global $$link;

 

if (USE_PCONNECT == 'true') {

$$link = mysql_pconnect($server, $username, $password);

} else {

$$link = mysql_connect($server, $username, $password);

}

 

these last couple of lines, one of which is 19, were of no consequence. We correctly guessed about about PHP, go us.

 

Thanks Ralph for your input, hope this will help anyone else. The error occurred suddenly, seemingly for no reason, but after we revisited the installation to start trying to get the store functioning, so were changing some settings but mainly through the control panel. I have tried to make this as thorough as possible so that hopefully it will turn up for people searching for the same problem.

Link to comment
Share on other sites

Good morning Hannah,

 

You shouldn't have had to hard code as you described below.

 

function tep_db_connect($server = localhost, $username = HAD_TO_REFILL_USERNAME_HERE, $password = ANDPASSWORDHERE, $database = AND_DATABASE_NAME_HERE, $link = 'db_link') {

global $$link

 

Those items you changed should be inserted dynamically from the catalog/includes/configure.php file from the lines

 

// define our database connection
 define('DB_SERVER', 'localhost'); // eg, localhost - should not be empty for productive servers
 define('DB_SERVER_USERNAME', 'yourusername goes in this spot');
 define('DB_SERVER_PASSWORD', 'yourpassword goes in this spot');
 define('DB_DATABASE', 'yourdatabasename goes in this spot');
 define('USE_PCONNECT', 'false'); // use persistent connections?
 define('STORE_SESSIONS', 'mysql'); // leave empty '' for default handler or set to 'mysql'

 

The need to hard code means there is still an error somplace. Watch out for it popping up again.

Just between us, remember there are only 10 kinds of people in the world; those who understand binary and those who don't!!

 

Remember, learning is a "do-it-yourself" experience; although, not necessarily a "do-it-BY-yourself" experience.

 

The quickest way to learn is to forget to BACKUP!

Link to comment
Share on other sites

Okay - there's definitely something gone wrong with the includes/functions/configure.php file, and now I've probably made it worse... Could I see a copy of someone's functioning file, with any identifying details changed, obviously? I'm also worried about whether the syntax is going alright, as some things seem to be in quotes and others not. I tried a fix but it hasn't worked and I'm not sure I used the right definitions.

thanks

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...