Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

error connecting to database


safire

Recommended Posts

I found a similar version of this error message in other topics.. but could not find anyone having the same problem. I went through the installation process.. which was successful. I can connect to the database and edit the store through the admin panel.. but when I go to view the store I get this error message:

 

Warning: Access denied for user: 'apache@localhost' (Using password: NO) in /home/httpd/vhosts/oregonliteracy.org/httpdocs/catalog/includes/functions/database.php on line 19

 

Warning: MySQL Connection Failed: Access denied for user: 'apache@localhost' (Using password: NO) in /home/httpd/vhosts/oregonliteracy.org/httpdocs/catalog/includes/functions/database.php on line 19

Unable to connect to database server!

 

connecting directly to my database on the server, not using mySQL or any other server, directly to the web.. here is my info I'm using to connect:

 

database server: localhost

username: (the one I set up for the database user)

password: (the one I set up for the database user)

database name: bookstore

 

is it the database server name that is the problem? should I contact my host and see if it should be something different like username@localhost or something? any ideas?

Link to comment
Share on other sites

open the admin/includes/configure.php and use those settings for the includes/configure.php where the password and db name is, at the bottom

Link to comment
Share on other sites

both of the configure files have the same information, I checked to be sure.. so they both have the database info at the bottom.

 

should I be able to edit products if the database is not connected? because I have a feeling it is connected, just not able to recognize that for some reason..

Link to comment
Share on other sites

If you can access the 'admin' part of the store but get this error with the 'catalog' part of your store then there is an error somewhere in includes/configure.php, and it relates either to the db name, user name, or password.

 

Vger

Link to comment
Share on other sites

I checked.. the passwords, name and server are both the same and correct in both configure.php files

 

is it the server name? does it need to be something other than "localhost" ??

 

i'm getting really frustrated with this.. been working on this for hours trying to find where I went wrong. I can't find the error! someone help me! please?

Link to comment
Share on other sites

I have seen this problem before, but I can't say for sure if it is the cause of your problem. You might want to check it out though.

 

Are you on a Linux server? If you are this may apply.

 

Many hosting companies are now upgrading their server operating system from RedHat to RedHat Fedora or RedHat Enterprise Linux. I can't speak about Fedora, but Enterprise Linux has switched 'localhost' to '127.0.0.1'. The thing is, most of the time 'localhost' will work, but it is sporadic, and I have seen 'localhost' working for one section of osCommerce but not in the other.

 

If you are on a Windows server this will not apply to you.

 

Vger

Link to comment
Share on other sites

maybe it's an error only seen in EI? does it work in Netscape?

 

can anyone see the store here? - http://oregonliteracy.org/catalog/

 

i'm getting ready to just give up on this..

 

it is still working perfectly on the admin side, but viewing catalog turns up the same error.. I have checked and rechecked the log ins and they are both the same in either of the configure.php files. I have talked to my hosting provider and they keep telling me that I"m entering in the right information. They only have access through 'localhost' and my username and passwords are correct.

 

I am totally a beginner with php and programming.. i'm trying to fix something I don't totally understand.. thanks for all the help.. but nothing seems to be working.

 

 

 

I have seen this problem before, but I can't say for sure if it is the cause of your problem.  You might want to check it out though.

 

Are you on a Linux server?  If you are this may apply.

 

Many hosting companies are now upgrading their server operating system from RedHat to RedHat Fedora or RedHat Enterprise Linux.  I can't speak about Fedora, but Enterprise Linux has switched 'localhost' to '127.0.0.1'.  The thing is, most of the time 'localhost' will work, but it is sporadic, and I have seen 'localhost' working for one section of osCommerce but not in the other.

 

If you are on a Windows server this will not apply to you.

 

Vger

Link to comment
Share on other sites

I have been notified by my host that I am supposed to connect to the database by localhost.

 

but..

 

the server info is as follows: Apache/2.0.40 (Red Hat Linux)

 

so does this mean that the server was upgraded like you were talking about Vger? I tried the ip address: 127.0.0.1 and that did not work for either configure file. It can only read the 'localhost' server name.. or as far as I can see

 

does that shed some light onto the problem?

 

 

 

I have seen this problem before, but I can't say for sure if it is the cause of your problem.  You might want to check it out though.

 

Are you on a Linux server?  If you are this may apply.

 

Many hosting companies are now upgrading their server operating system from RedHat to RedHat Fedora or RedHat Enterprise Linux.  I can't speak about Fedora, but Enterprise Linux has switched 'localhost' to '127.0.0.1'.  The thing is, most of the time 'localhost' will work, but it is sporadic, and I have seen 'localhost' working for one section of osCommerce but not in the other.

 

If you are on a Windows server this will not apply to you.

 

Vger

Link to comment
Share on other sites

Red Hat Linux is the old version so that should be okay, and MySQL 2.0.4 should be okay. This is the error I am getting

 

Warning: mysql_connect(): Access denied for user: 'apache@localhost' (Using password: NO)

 

This indicates that no password is being selected. Try going to your web hosting control panel, find the link for mysql, and then the link for mysql password. If there is a Change Password function then use this to 'change' the password to the one you are using in your configure.php files.

 

I also find it odd that the user name is 'apache', because this would indicate that it is the server itself, and no hosting company would give you those privileges.

 

Vger

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...