Topic on Project:Support desk

[RESOLVED] DB connection error when running deleteArchivedRevisions.php

3
Julievancouver (talkcontribs)

Hello, mediawiki version 1.19.2 MAMP:

 php 5.3.6
 mysql 5.5.9

Mac OSX 10.7.5 Using terminal window, I navigate to maintenance directory. I run: php deleteArchivedRevisions.php I get: DB connection error: No such file or directory (localhost)

In my file LocalSettings.php, I have both regular and superuser (wgdbadmin) usernames and passwords. Any suggestions?

Thanks. Julie

Ciencia Al Poder (talkcontribs)

See if this helps you: .

Maybe the PHP command line binaries are different from the PHP used in the webserver, or point to different php.ini configuration files, in which case the location of the mysql socket may be wrong in the PHP CLI installation. If that's the problem, fix it in the php.ini of the CLI or symlink it as suggested on the link I gave.

Julievancouver (talkcontribs)

Thanks for your suggestion. It put me on the right track. From the command line, the php that was called was not the one that was running my mediawiki. By putting the full path to the proper php on the command line, it all worked:

/Applications/MAMP/bin/php/php5.3.6/bin/php deleteArchivedRevisions.php

As you can tell, I'm a newbie.

Reply to "[RESOLVED] DB connection error when running deleteArchivedRevisions.php"