Page MenuHomePhabricator

Maintenance scripts do not work with Postgresql
Closed, ResolvedPublic

Description

Author: davidlee

Description:
I am using a PostgreSQL backend, but maintenance scripts try to access MySQL.

Running maintenance scripts give the following error:
DB connection error: MySQL functions missing, have you compiled PHP with the --with-mysql option?


Version: 1.12.x
Severity: major

Details

Reference
bz13251

Related Objects

View Standalone Graph
This task is connected to more than 200 other tasks. Only direct parents and subtasks are shown here. Use View Standalone Graph to show more of the graph.
StatusSubtypeAssignedTask
InvalidNone
ResolvedNone

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 10:08 PM
bzimport set Reference to bz13251.
bzimport added a subscriber: Unknown Object (MLST).

overlordq wrote:

Which scripts are you trying to run? WFM even after I completely disable mysql.

host:# php -r '$connect = mysql_connect("localhost", "root", "password");'

Fatal error: Call to undefined function mysql_connect() in Command line code on line 1

host:# # php update.php
MediaWiki 1.13alpha Updater

Going to run database updates for wikidb
Depending on the size of your database this may take a while!
Abort with control-c in the next five seconds...2
...
... obsolete version of index "pagelink_unique index" does not exist
... index "pagelink_unique_index" aready exists
... constraint "revision_rev_user_fkey" is ON DELETE RESTRICT

Done.

davidlee wrote:

I'm trying to run rebuildImages.php.

The error also appears when I try to run rebuildall.php or cleanupImages.php.

rebuildtextindex.php specifically returns "This script is only for MySQL."

update.php worked for me as well.

overlordq wrote:

Ah yea. IANADev but to me it looks like that those scripts don't properly create the right database class, they just use Database instead of checking to see if it should use DatabasePostgres instead.

As per bug 9905 and rebuildtextindex:

"Closing: no script is needed to rebuild the full text indexes on Postgres, it's all trigger based. (Thanks for the r22172 change though)."

Thanks, this should be fixed as of r31958

Jdforrester-WMF subscribed.

Migrating from the old tracking task to a tag for PostgreSQL-related tasks.