Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

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


jewelplus

Recommended Posts

Posted

Since yesterday I am unable to access my oscommerce admin nor the catalog page. I receive the following error message:

 

Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'MyUsername'@'localhost' (using password: YES) in /home/oscommerce/admin/includes/functions/database.php on line 19

Unable to connect to database server!

 

After reading several posts and contacting my host, I think I narrowed down the cause of error to be an incorrect password in my oscommerce configuration files named "configure.php" located at: catalog/admin/includes and also at catalog/includes. Here are the last few lines from these files in my folder:

 

define('DB_SERVER', 'localhost');

define('DB_SERVER_USERNAME', 'xxxMyUsername');

define('DB_SERVER_PASSWORD', '[xxx{xxxxx'); (notice the two extra opening brackets within the password which is kind of strange)

define('DB_DATABASE', 'MyDatabaseName');

define('USE_PCONNECT', 'false');

define('STORE_SESSIONS', 'mysql');

 

To try and solve the problem I tried changing the username & password for the database by gogin to the "Cpanel" in my host's website, then clicking on "MySQL Databases", then first deleting the username for the database, then I "created another user", and then "Add the user to the database". However unfortunately the exact same error message shows up when trying to access my oscommerce site.

 

I also thought about manually adding the password to the two oscommerce configuration files, however there is no way I can see the encrypted password by while in the "MySQL Databases" section (looks like you can only create or delete a user, and you cannot view or change the password). I was thinking to myself if somehow there was a way to retrieve the possibly encrypted password for the user that I added in the "MySQL databases" section, and then manually add it to the oscommerce configuration files?? maybe that is worth trying but I do not know how.

 

I also tried going to my "phpMyAdmin", clicking on the oscommerce database, clicking on "administrators", then clicking "Browse" and I can see only one username (the one I originally created when I installed oscommerce some time ago) with a very long series of numbers for the user_password. I really don't know what I can do here.

 

I am stuck......any assistance would be greatly appreciated.

Posted

This is certainly a password error.

 

You can only reset the password via cPanel.

 

Reset it, then update the config files, and you should be good to go.

Forget extra brackets, it should only be

define('DB_SERVER_PASSWORD', 'YOUR_PASSWORD');

 

It is likely the old password had an opening bracket in it, so it just looks odd. I am pretty sure you can get away with a "[" in a password, not that i know why you would want to.

 

Rob

Rob Bell - Inspired Graphix

Customising osCommerce in Australia, and the world!

View my profile for web and email links.

 

I'm sorry, but i cannot offer Free support via PM etc, and osCommerce forums prohibit me from putting any reference to paid support in my signauture.

However viewing my profile may provide links to my website or something like that which you may find useful.

Posted

Thanks, but once I create a new user and add the user to the database via cPanel, how can I then add the password for that user to the configure.php files? I cannot find any way to view the encrypted password for that particular user.

 

By the way, configure files both have 644 permission.

Posted

The password is put into the configure.php files in PLAIN text.

So whatever you typed into cpanel for the password for that user, put that in your configure.php.

 

You don't need to view the encrypted password.

 

Don't forget that in cPanel you also have to assign users to any given database to allow them to work on that database too.

 

Once it's all set, change configure.php permissions to 444 for security and to stop the warnings.

 

Rob

Rob Bell - Inspired Graphix

Customising osCommerce in Australia, and the world!

View my profile for web and email links.

 

I'm sorry, but i cannot offer Free support via PM etc, and osCommerce forums prohibit me from putting any reference to paid support in my signauture.

However viewing my profile may provide links to my website or something like that which you may find useful.

Posted

Thank you so much, the problem is solved now.........as you have suggested the password is in PLAIN TEXT and not encrypted.....For some reason my password in both configuration files were suddenly shown as something like this "[ABC{aBCCCC", and since this was not the password I entered in the cPanel I thought they were encrypted. I replace this garbled password with the PLAIN TEXT password in both configuration files and I was able to access my oscommerce site just fine.....smooth.......I was struggling with this for few days, thank you so much for the tip and your support.

Archived

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

×
×
  • Create New...