mysql_connect() [function.mysql-connect]: Access denied

intratt - October 1, 2008 - 06:16

* warning: mysql_connect() [function.mysql-connect]: Access denied for user 'nobody'@'localhost' (using password: NO) in /home/a4432462/public_html/drupal/modules/oscommerce/oscommerce.module on line 254.
* warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /home/a4432462/public_html/drupal/modules/oscommerce/oscommerce.module on line 288.
* warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/a4432462/public_html/drupal/modules/oscommerce/oscommerce.module on line 289.
* warning: mysql_connect() [function.mysql-connect]: Access denied for user 'nobody'@'localhost' (using password: NO) in /home/a4432462/public_html/drupal/modules/oscommerce/oscommerce.module on line 254.
* warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /home/a4432462/public_html/drupal/modules/oscommerce/oscommerce.module on line 363.
* warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/a4432462/public_html/drupal/modules/oscommerce/oscommerce.module on line 364.

Assuming that you already

cog.rusty - October 1, 2008 - 06:55

Assuming that you already have oscommerce configured with its own database, the module must have some settings, probably in Drupal's /settings/oscommerce page, were you must specify the db host, db name, db user and db password for oscommerce.

SQL connection issue

concept27 - October 20, 2008 - 23:49

There is no setting under settings. Where can we set the db login information?

Been there... And now I am

cesar.brod@gmail.com - April 14, 2009 - 14:56

Been there... And now I am there again. For some reason, under http://yoursite/admin/settings/oscommerce I am not able to configure my database connections. So, I edited osscomerce.module, around line 245 and so on:

/**
* Make database connection
* Returns database object for osCommerce or false if no connection made
*/
function oscommerce_db() {
$host = variable_get('oscommerce_host', 'yourhost');
$database = variable_get('oscommerce_database', 'yourdatabase');
$user = variable_get('oscommerce_user', 'youruser');
$password = variable_get('oscommerce_password', 'yourpassword');
$db = mysql_connect($host, $user, $password);
if ($db) {
if (!mysql_select_db($database, $db)) {
$db = FALSE;
};
}
return $db;
}

Change 'your***' for your variables and, on http://yoursite/admin/settings/oscommerce, you should at least see "Link to osCommerce database is valid" on the top of your page. From there you may keep on your debugging.

 
 

Drupal is a registered trademark of Dries Buytaert.