Topic on Project:Support desk

Jump to navigation Jump to search

A database query syntax error has occurred. Help please!

8
200.151.85.122 (talkcontribs)

Hello, people. I'm from Brazil and my Wiki (wiki.animekey.net) have a problem. Everytime I try to execute some functions(like "protect"), the following messages appears:


A database query syntax error has occurred. This may indicate a bug in the software. The last attempted database query was:

   (SQL query hidden)

from within function "IndexPager::reallyDoQuery (LogPager)". Database returned error "1176: Key 'log_user_type_time' doesn't exist in table 'logging' (localhost)".


I'm a newbie and I don't know what to do. Help, please.

MediaWiki 1.16.2 PHP 5.2.13 (apache2handler) MySQL 5.1.47

Thanks all of you.

Emufarmers (talkcontribs)
63.149.19.142 (talkcontribs)

I'm having the same error message and I think I have finished updating. I have several other similar errors when trying to edit pages, delete pages, etc.. while logged in. Editing pages without logging in seems to work fine.

This is an update from 1.15.0.

MediaWiki: 1.16.2
Wiki: http://pipedia.org
PHP: 5.2.15 (cgi-fcgi)
MySQL:	5.1.52

I may have botched the update at several steps. Here is what I've done:

  • Uploaded new files
  • Re-Ran the web installer per instructions, but may have selected the wrong database type. It returned that it was expecting schema5 and found schema 4 and could not convert it to schema 5. The result was error messages like the above.
  • Re-Ran the web installer again using the backward compatible option for schema 4. No change in error messages.
  • Ran update.php script from SSH shell (It appears I might have been using PHP4 though). No change in error messages.
  • Re-Ran the update.php script from SSH shell using PHP5 for sure. No change in error messages.
  • Finally I tried uploading a back up of the database, and ran the update.php script on it, but it looks like my backup may have issues as it did not import cleanly. I could not get it to work at all and switched back to the original partially updated database with the error messages, which is where I am now.

I'm sorry, I realize this is a mess. Any hope?

Thanks for any help, which I would really appreciate. I'm about at my whits end with this. Scott

Just edited this after logging in, which I should have done before, sorry..

Bawolff (talkcontribs)

Please include exact error messages.

Sethile (talkcontribs)

Thanks, Bawolff!

Here's the one when trying to block a user (spambot), or delete the new page full of spam:

A database query syntax error has occurred. This may indicate a bug in the software. 
The last attempted database query was:

   (SQL query hidden)

from within function "IndexPager::reallyDoQuery (LogPager)". Database returned 
error "1176: Key 'log_user_type_time'   doesn't exist in table 'logging' (localhost)".

And here is one when trying to edit a page while logged in:

A database query syntax error has occurred. This may indicate a bug in the software. 
The last attempted database query was:

   (SQL query hidden)

from within function "LogPage::saveContent". Database returned error 
"1054: Unknown column 'log_page' in 'field list' (localhost)".

Thanks very much for any insight you might have, Scott

Bawolff (talkcontribs)

I meant was the exact text of the "It returned that it was expecting schema5 and found schema 4 and could not convert it to schema 5" error?

Sethile (talkcontribs)

Oh, sorry.. I ran it again. Here it is exactly:

Warning: you requested the mysql5 schema, but the existing database has the mysql4 schema. 
This upgrade script can't convert it, so it will remain mysql4.

This is not from the update.php script, but when I re-run the web installer.

Thanks, Scott

Sethile (talkcontribs)

This is fixed, thanks to Platonides on mediawiki-l!

   > Platonides asks:
   >
   >> What errors are you getting?
   >> (eg. table foo not found)
   >>
   >> What does update.php say?
   >> (eg. table foo already exists)
   >>
   >>
   > Thanks for asking!
   >
   > Here's the one when trying to block a user (spambot), or delete the new page
   > full of spam:

   Key 'log_user_type_time'   doesn't exist in table
   Unknown column 'log_page'
 
   Both items are added in patch-log_user_text.sql
   log_user_text

   > Here is the report from update.php:
   > ...have log_user_text field in logging table.

   log_user_text field is added in that same patch, so it assumes all of
   them are in the table.

   I don't know how did you end up with such half-applied patch.
   What engine are you using? MyIsam, Innodb... ?
 
   You can execute
    ALTER TABLE logging DROP COLUMN log_user_text;

   Then rerun update.php which should now pick that full patch.

That fixed it!

I think the half applied patch may have had to do with doing the update from the web installer, and selecting the wrong option for the database on the frist go around, but I don't know.

I'm using MyISAM. I used Innodb at first but it was less stable on the server I was on so I switched.

What a relief to have this fixed. Thanks to all! Scott

Reply to "A database query syntax error has occurred. Help please!"