Home » Technology » Couldn’t connect to database server magial_rules error

Couldn’t connect to database server magial_rules error

written by Anand February 2, 2012

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.

Did this post help you?
SmartHomeBeginner brings in-depth tutorials easy enough to understand even for beginners. If you are reading this, please consider buying us a coffee (or two) as a token of appreciation.
Write for Us: Competitive pay. Familiar with Smart Home Automation, Media Streaming, HTPC, and Home Server topics? Tinkerers and hobbyists preferred. Writing experience not required. APPLY HERE.

Related Articles