MediaWiki: Langlinks doesn't exist

After doing the automatic one-click upgrade from 1.7.0 to 1.7.1, my MediaWiki installation no longer works. I get the following error every time I try to edit:

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 “LinksUpdate::getExistingInterlangs”. MySQL returned error “1146: Table ‘ghanawiki.wiki_langlinks’ doesn’t exist (”.

I never saw this before the 1.7.1 upgrade. And when I check the database, there is indeed no langlinks table.

I see that at least one other user has experienced this problem:

Does anyone know how to solve this?

I did some more research on this, and it seems the maintenance/refreshLinks.php script would fix this problem. Unfortunately, I get errors when I run it:

western:~/ vocaro$ php refreshLinks.php
X-Powered-By: PHP/4.4.2
Content-type: text/html

Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or ‘}’ in /home/.carisma/vocaro/ on line 114

The errors were due to PHP 4 installed on the shell account, while MediaWiki requires PHP 5.

However, after using PHP 5 to run the maintenance script, I still got errors complaining that the langlinks table did not exist.

Luckily, I found the definition of the table in maintenance/tables.sql and was able to create the table manually. That fixed the problem.

Here is the statement I used:

CREATE TABLE wiki_langlinks (
ll_from int(8) unsigned NOT NULL default ‘0’,
ll_lang varchar(10) binary NOT NULL default ‘’,
ll_title varchar(255) binary NOT NULL default ‘’,
UNIQUE KEY (ll_from, ll_lang),
KEY (ll_lang, ll_title)
) TYPE=InnoDB;

I had the same issue and fixed it by running update.php and refreshLinks.php from the command line.

Alec Usticke
DreamHost referral

I also had the same problem in addition to a problem with uploads not being allowed. I was going from 1.6x to 1.7.1

It seemed like the command line PHP execution tool was running on PHP 4.x and wouldn’t parse the PHP 5 wiki upgrade.php properly for me, so I re-ran the wiki installer.

The feedback that I got after it had run showed that the langlinks tables didn’t exist and that some other things were slightly askew.

Now everything works great.

had same error

my failure was: at the same machine 2 versions of php were running, 4.x and then 5.x …

just check it if u do ‘php -v’ in your shell…

i used manualy the path to the 5.x php and it worked ^^

can be “fixed” to “overwrite” the old php with editing the .bashrc in your homedir…

*open the file with ‘pico .bashrc’ (or other favorite editor)

*find a nice place for the line, can be on end (scroll down with “page down”)

*add new line --> alias php=’/usr/local/php/bin/php’

(adjust the path to your path!)


*reload the bashrc… with ‘source .bashrc’

check now with ‘php -v’ ^^

and it should work then with ‘php update.php’ otherwise : ‘/usr/local/php/bin/php update.php’ ^^


Hi there!

This is just to report that the manual SQL creation worked fine for me.

Thanks a lot, Vocaro!

– Wayfarer

Can someone provide a little more information about how to manually adding the SQl entries?


Hi Jesse

First of all, check if you have a similar error when trying to upload a picture. If so, there is a completely different workaround.

If the only error is when editing, you can solve it via phpmyadmin. Steps follows:

1.- Go to ans access phpmyadmin with your DB username and password.
2.- On the left frame, choose the wiki database in the dropdown box.
3.- Once selected, also on the left frame click on the “Query Window” icon… It’s the one with the letters ‘SQL’ on it. The query window will open. Mind that you must see something like “Execute the SQL query on database ‘yourwikidatabase’”.
4.- Paste the SQL instructions. Mind the table preffixes!!! If your table preffix is other than ‘wiki_’, you MUST change it.
5.- Click on continue
6.- Check if there are any errors and if not, just accept.
7.- You’re done :wink:

Hope it’ll work.


– Wayfarer

That worked great!