Forums / General Questions / Db_error_not_connected

Db_error_not_connected

Started by iddy on 3 May 2012, 9:50 PM · Views: 863

Results 1 to 7 of 7
3 May 2012, 9:50 PM
#1
iddy avatar

iddy

Zen Follower

Join Date:
Jan 2009
Posts:
119
Plugin Contributions:
0

Db_error_not_connected

Hi,

I'm getting an error when trying to access either the webshop or the admin section.

shop front error = Sorry!
There seems to be a problem connecting to our database. Please give us a few minutes to remedy the problem. Thank you.

admin error = 0 DB_ERROR_NOT_CONNECTED
in:
[select * from zen_project_version WHERE project_version_key = 'Zen-Cart Database' ]
If you were entering information, press the BACK button in your browser and re-check the information you had entered to be sure you left no blank fields.

i think is this is causing the problem. I went into phpmyadmin and tried to optimise the database (selected all the tables and then selected optimise).

Unfortunately then I had a power failure and had to leave everything the way it was. I logged onto cpanel from another computer but cannot access phpmyadmin now... and then noticed the connection errors.

So where do i go from here? I'm assuming that i overloaded things by selecting all the tables and this has messed things up.

And to make things worse i dont have a backup of my database....

The second thing i did today... change the includes/configure.php file SQL_CACHE_METHOD from "none" to "file". I copied/changed the file extension of the original one and modified the copy. The original file has been restored (changed the extension back)

Thanks for any help/ suggestions

Iddy

4 May 2012, 12:17 AM
#2
iddy avatar

iddy

Zen Follower

Join Date:
Jan 2009
Posts:
119
Plugin Contributions:
0

Re: Db_error_not_connected

I found the tutorial on this error thanks to the similar thread suggestion below. Dont know what i was doing when i searched earlier.

4 May 2012, 2:06 AM
#3
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: Db_error_not_connected

So problem is solved?

NOTE: We are sorry that Rod is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

Ozpost - The Ultimate Shipping module for Australian Merchants. Click these links for its Homepage, or Download from Zen-Cart.com.

4 May 2012, 7:47 AM
#4
iddy avatar

iddy

Zen Follower

Join Date:
Jan 2009
Posts:
119
Plugin Contributions:
0

Re: Db_error_not_connected

no still not solved. I'm currently running through repairing the db but it kinda looks like phpmyAdmin is spinning its wheels but getting no where with it so i'll open a support ticket with my hosting company to see if they can help.

4 May 2012, 8:53 AM
#5
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: Db_error_not_connected

iddy:

no still not solved. I'm currently running through repairing the db but it kinda looks like phpmyAdmin is spinning its wheels but getting no where with it so i'll open a support ticket with my hosting company to see if they can help.

Good idea. I have a feeling that this will be your only solution,

iddy:

I'm getting an error when trying to access either the webshop or the admin section.

shop front error = Sorry!
There seems to be a problem connecting to our database. Please give us a few minutes to remedy the problem. Thank you.

admin error = 0 DB_ERROR_NOT_CONNECTED

Assuming that no one had messed with your config files (in particular, the DB logon details) this is almost certaintly a server error, and there would be nothing that you could do to fix it. It would be a job for your host.

iddy:

[select * from zen_project_version WHERE project_version_key = 'Zen-Cart Database' ]
If you were entering information, press the BACK button in your browser and re-check the information you had entered to be sure you left no blank fields.

i think is this is causing the problem.

Not so. That would be just a symptom, not the cause.

iddy:

I went into phpmyadmin and tried to optimise the database (selected all the tables and then selected optimise).

On the other hand, if you could connect to the DB with phpmyadmin, then the server itself is/was actually functional at that time.

iddy:

Unfortunately then I had a power failure and had to leave everything the way it was.

A power failure on your local host will have no effect on what the server was doing at the time. It would have continued its task without even a hiccup. <sp>

iddy:

I logged onto cpanel from another computer but cannot access phpmyadmin now... and then noticed the connection errors.

I'm a little confused, I thought your conenction errors started before you optimised the DB and had the power failure.
Were these the same errors, or different?

iddy:

So where do i go from here?

Enlist the aid of your host.

iddy:

I'm assuming that i overloaded things by selecting all the tables and this has messed things up.

Very unlikely.

iddy:

And to make things worse i dont have a backup of my database....

Rule#1 of computing. Back up everything. Often.
Rule#2. Make sure you know how to restore using the backups.

iddy:

The second thing i did today... change the includes/configure.php file SQL_CACHE_METHOD from "none" to "file". I copied/changed the file extension of the original one and modified the copy.

Are you sure this wasn't the 1st thig you did? (just asking). The thing is, if you mess up this file, then PHP will have a problem parsing it, with means that it woudn't have been able to read the DB login details, which will produce the exact error that you 1st reported ( 0 DB_ERROR_NOT_CONNECTED)

iddy:

The original file has been restored (changed the extension back)

Thanks for any help/ suggestions

Iddy

There are only two possible causes for this error. Your configure files were changed (and something got broke as a result), or the SQL server itself had a serious failure.

Work with your host so that you can first get phpmyadmin working again, and if you still have problems with zencart (re)check your zencart configuration files.

The idea of getting phpmyadmin working first is because this is something that only your host can fix. Also, there is nothing that you can do to cuase it to fail in the 1st place... IOW, you are taking yourself out of the equation.
When phpmyadmin is functional you can be pretty confident that the SQL server itself is also fully functional, which is when you'll need to come back to the zencart issues (assuming they aren't fixed at the same time).

Cheers
Rod

NOTE: We are sorry that Rod is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

Ozpost - The Ultimate Shipping module for Australian Merchants. Click these links for its Homepage, or Download from Zen-Cart.com.

4 May 2012, 9:12 PM
#6
iddy avatar

iddy

Zen Follower

Join Date:
Jan 2009
Posts:
119
Plugin Contributions:
0

Re: Db_error_not_connected

Thanks for the detailed reply Rod. My Hosting company sorted it for me. I had exceeded the mysql connection limits. They cleared it and everything works again..

5 May 2012, 5:46 AM
#7
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: Db_error_not_connected

iddy:

Thanks for the detailed reply Rod. My Hosting company sorted it for me. I had exceeded the mysql connection limits. They cleared it and everything works again..

I don't now if I should tell you this or not, but your hosting company is telling you porkies.

Yes, it is true that MySQL has a defined limit on the number of connections it can handle, but this is a global option that pertains to all users of the database server, not just you or any other specific user.

http://dev.mysql.com/doc/refman/5.5/en/too-many-connections.html

I can't imagine why they would be trying to place the cause on you (or ZenCart) when the problem was caused by a limitation or problem with their server.

Cheers
Rod

NOTE: We are sorry that Rod is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

Ozpost - The Ultimate Shipping module for Australian Merchants. Click these links for its Homepage, or Download from Zen-Cart.com.