Couldn’t connect to database server magial_rules error

After a recent WordPress update (to 3.3), one of my blogs showed the following error:

Couldn't connect to database server. Couldn't find database magical_rules. An unexpected problem has occured with the application.

SELECT statscurl_id FROM `statscurl` WHERE statscurl_ip = '';

So how to solve this problem? Googling lead me to various websites and blogs that discussed possible solutions to this problem. This seems to be a problem specifically with Elegant Themes. Below is what worked for me.

While opening my blogs, I have always wondered why the page was trying to access "http://www.4llw4d.freefilesblog.com". This looked fishy to me. I tried to find out but gave up after a few minutes. I discovered that something had changed in this link "http://www.4llw4d.freefilesblog.com" and that was causing the database error described above.

In order to solve the above problem, edit the header.php file located under /wp-content/themes/ThemeName. You may do this from wordpress dashboard->Appearance->Editor or using your favorite text editor if you have access to the server.

Find the following line:

$url = "http://www.4llw4d.freefilesblog.com/jquery-1.6.3.min.js";

Comment it out as shown below so that the line is skipped during page display.

/* $url = "http://www.4llw4d.freefilesblog.com/jquery-1.6.3.min.js"; */

Save the file and refresh your page. The database error should now go away.

If you would like to optimize your WordPress URL structure to make it more search engine and user friendly, please read this post.

Hope this helps.

Be the 1 in 200,000. Help us sustain what we do.
34 / 150 by Dec 31, 2024
Join Us (starting from just $1.67/month)

Anand

Anand is a self-learned computer enthusiast, hopeless tinkerer (if it ain't broke, fix it), a part-time blogger, and a Scientist during the day. He has been blogging since 2010 on Linux, Ubuntu, Home/Media/File Servers, Smart Home Automation, and related HOW-TOs.