database connection error

I am having a database connection error on wordpress.

After a post, the site spins for a long time and gives one liner database connection issue. Sometimes, the site shows wordpress error page "Error establishing a database connection" and wants me to check wp-config.php and states cant contact the database server.

When I check the log. I see…

[error] PHP Fatal error: Call to undefined function wpcacheget() in /srv/www/ on line 346

I checked on line 346````
$notoptions = wpcacheget( 'notoptions', 'options' );

from line 344 to 350````
    if ( ! defined( 'WP_INSTALLING' ) ) {
        // prevent non-existent options from triggering multiple queries
        $notoptions = wp_cache_get( 'notoptions', 'options' );
        if ( isset( $notoptions[$option] ) )
            return $default;

        $alloptions = wp_load_alloptions();

I have

mysql 5.1.41

wordpress 3.2.1


for cache I have w3tc


I am on lamp set up.

thank you.

4 Replies

I followed a few of the threads, and seemed to solve the issue

these links should help anyone that has the same issue … networking"> … 0.04-lucid">

The second link is broken … 0.04-lucid">


The second link is broken … 0.04-lucid">

This is most likely because 10.04 isn't supported at all by Canonical at this point. If you're using Ubuntu 10.04 I'd really recommend upgrading to a more recent version of Ubuntu to avoid running into complications.

If you're actually running a more recent version, these guides should be applicable: … e-pangolin"> … untu-14-04">

If you're not running Ubuntu at all, we have guides for CentOS 6/7, Debian 7/8 and Arch Linux as well:

Hope this helps!


The second link is broken … 0.04-lucid">

It's a 4.5 year old post…


Please enter an answer

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct