WordPress and Joomla MySQL Problems

Almost since I started using php and MySQL based website development tools I have been having a recurring problem.  When editing posts or content lists of items would fail to appear.

In Joomla Content Management System the lists of articles, sections, categories and users would fail to appear, but not in any consistent manner.

In WordPress the categories and tags would fail to display, also quite randomly.

My hosting is by Brinkster, using the Pro Windows package, and Windows may also be a part of the problem.

Sometimes I used the Brinkster Support -> Live Chat technician, and they would poke something behind the scenes, or I would go away, do something else and come back the next day.

This time I decided to dig deeper.

After a lot of searching through the WordPress documentation I found a few snippets that pointed me in the right direction.  Normally Joomla and WordPress (and also web browsers) suppress error information so as not to upset you, but there are times when you want to know why things are not working.

In my WordPress machinations I found some code snippets that could be inserted or modified to tell me what was going on.

At the end of wp-config.php I added the following lines to instruct WordPress to tell me when it was wrong:

[sourcecode language='php']

define(’WP_DEBUG’, true);

ini_set(“display_errors”, 1);

[/sourcecode]

I got that from here and some posts on the WordPress forums.  It didn’t seem to do much though, so apparently the problem was not with the WordPress code.

I continued my search and found that for some people their MySQL server wasn’t responding fast enough “MySQL server has gone away” - something to do with timeout settings.  So I was straight into the wp-includes/wp-db.php file, but before I had scrolled too far down (line 61, or thereabouts) I found the line

[sourcecode language='php']

var $show_errors = false;

[/sourcecode]

I changed it to

[sourcecode language='php]var $show_errors = true;[/sourcecode]

And did a hard refresh (ctrl+F5) on my browser and suddenly there was lots of information.  The most telling of which was

[sourcecode language='php']

[Can't create/write to file 'C:/WINDOWSTEMP/#sql_74b4_0.MYD' (Errcode: 17)]

[/sourcecode]

Bingo.  Definitely a MySQL error.  Just like Cowboy Programming found.

My understanding is that the server gets clogged up with temporary files, which interferes with requests for information from database tables.  The requests most affected are the ones pulling many rows of values from the database, so you see the post body but not the list-based things like tags and categories.

In my case the solution was to get onto the support technicians at my hosting company and have them refresh or reset the server.

If you have the permissions on your server you could also use a tool like phpmyadmin to refresh it yourself.

Along the way I also found that if you insert

[sourcecode language="php"]phpinfo()[/sourcecode]

into functions.php then it tells you all about the system running on your host.

Leave a Reply

 

 

 

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>