Technik, Gothic und Anderes

Technik ist Spiel, Gothic ist ernst und Zeit hat man zuviel

Installation von Drupal ohne “CREATE TEMPORARY TABLE” Rechte unter MySQL

Geschrieben von skaldrom am 27. September 2007 / deutsch

Problem

Drupal

Some hosting providers do not grant the MySQL-userright CREATE TEMPORARY TABLES to their customers. Maybe because it’s full moon at the moment and everyone seems a bit crazy. But a href=”http://drupal.org/”>Drupal really wants this right and so a workaround is needed :-(

The error during the installation could be something like this:

user warning: Access denied for user: 'drupal@%' to database 'drupal' query: CREATE
TEMPORARY TABLE missing_nids SELECT n.nid, n.created, n.uid FROM node n LEFT
JOIN node_comment_statistics c ON n.nid = c.nid WHERE c.comment_count IS NULL in
/var/websites/drupal/includes/database.mysql.inc on line 167.

Kind of a Solution

I have written a patch for Drupal 5.2 which should kinda solve the problem. In Drupal, CREATE TEMPORARY TABLES is only used in the db_query_temporary function, found in the file includes/database.mysql.inc, which is a very clean progamming style! Basically, this patch creates a real table instead of a temporary one. The name and the creationdate is stored in an extra table called temporary_table. The cron.php removes these tables on a regular base. If the table already exists, it is dropped.

This patch only works for MySQL and MySQLI and may be a performance loss. I have tested this patch only on a low traffic site and I do not know if there are race conditions. Use it on your own risk…

Addendum

Another solution has been posted at Drupal.org.

Here it is: Patch to use Drupal without the CREATE TEMPORARY TABLES.

To apply it, change into the Drupal base directory and issue patch -p0<drupalwotemptables.patch on the commandline.

Teile und geniesse:
  • Technorati
  • del.icio.us
  • MisterWong
  • Digg
  • StumbleUpon
  • blogmarks
  • Furl
  • Simpy
  • Spurl
  • YahooMyWeb


Lassen Sie eine Antwort hier...

XHTML: Sie können folgende Tags verwenden: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>