Project:Support desk/Sections/Database

__NEWSECTIONLINK__ = MediaWiki Database Support =

Text table question
I installed the latest, it works well. However, I'm on WAMP, and I have PHPMyadmin, how do I view the text table?? AC —82.42.237.84 13:10, 20 December 2008 (UTC)
 * MediaWiki version: SVN build TortoiseSVN
 * PHP version: LATEST
 * MySQL version: LATEST
 * URL:
 * I don't really get your question, if you have PHPMyAdmin and you want to see the text table just do so. --IvanStepaniuk 15:37, 28 January 2009 (UTC)

Page links with national characters disappeared after database migration

 * MediaWiki: 1.10alpha
 * PHP: 5.2.6 (ucgi5)
 * MySQL: 5.0.66a-log
 * URL: http://www.krokpokroku.pl/wiki/index.php?title=Inspiracje


 * MediaWiki: 1.13.3
 * PHP: 5.2.6 (cgi-fcgi)
 * MySQL: 5.0.67-log
 * URL: http://mat.extremefaith.info/kpk/mediawiki-1.13.3/index.php?title=Inspiracje

Hello,

I need help with the following problem.

I am moving a MediaWiki based webpage from one server to another. After exporting the database and importing it to the new server I got the message "1271: Illegal mix of collations for operation ' IN ' (mysql.extremefaith.info)". So I updated MediaWiki to the newest stable version (1.13.3) which caused the change of the $wgDBmysql5 variable value to "true" and that solved the problem.

Yet another one appeared. Although the content of the present pages remained unchanged (all the national characters were present) all the links with national characters became "red" (f.ex. "Śnieżnobiałe światło") and I can't access the content of those pages. What's more when I add the content manually some pages still remain "red". When I click on this kind of edited-"red" page I can see the content but it's being opened in "edit" tab by default. All the tables have "latin2_general_ci" collation set.

Could you please help me to fix the "red" links with national characters?

(You can see the red links f.ex. here: http://mat.extremefaith.info/kpk/mediawiki-1.13.3/index.php?title=Teksty_pie%C5%9Bni)

—Smatric 19:38, 27 December 2008 (UTC)

Content is no longer visible, and I cannot log in to my account

 * MediaWiki version: 1.13.3
 * PHP version: 5.2.8
 * MySQL version: 5.0.67

All my pages are showing me the "There is currently no text in this page..." message, and I cannnot log in to my account. I can view the 'recent changes' page. I can't see the history of any pages, yet I can see the diffs. My web host recently upgraded from MySQL 4 to 5, so perhaps it's something to do with that.

Does anyone know of something I can do to restore my wiki? Being able to view the diffs, I think the content is still in there somewhere.

—WabsBio 10:24, 19 January 2009 (UTC)

I have the same problem. I checked the DB. The content still there. How to solve this problem?

--Nasario 11:30, 12 February 2009 (UTC)

(RESOLVED) Can't view content pages - DB Error!
We recently updated to ver.1.13 from 1.11 as well as changed over to a new server for both our site and db server. When we view any content page we recieve the following error:
 * MediaWiki version: 1.13 (upgraded from 1.11)
 * PHP version: 5.2.6
 * MySQL version:  5.0.45-community-nt
 * URL: http://www.bandwiki.net/

A database query syntax error has occurred. This may indicate a bug in the software. The last attempted database query was: SELECT page_id, page_namespace, page_title, page_len, page_is_redirect, pp_value FROM `sb_wiki_page` LEFT JOIN `sb_wiki_page_props` ON pp_propname='hiddencat' AND pp_page=page_id WHERE (page_namespace=14 AND page_title='Band♪Wiki_Extensions')

from within function "OutputPage::addCategoryLinks". MySQL returned error "1146: Table 'nwpos09_bandwiki.sb_wiki_page_props' doesn't exist (lord.my-hosting-panel.com)".”

The same error pretty-much occurs with 'sb_wiki_protected_titles' when viewing pages like the 'Privacy Policy' as well.

—64.91.123.139 14:11, 19 January 2009 (UTC)


 * Run the update script. —Emufarmers(T 14:38, 19 January 2009 (UTC)

Database error

 * MediaWiki version: 1.14alpha (r4589)
 * PHP version: 5.2-4-2ubuntu5wm (apache2handler)
 * MySQL version: 4.0.40-wikipedia-log
 * URL: http://www.marinegouge.com

When trying to access this page, I get the error:

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 "MediaWikiBagOStuff::_doinsert". MySQL returned error "1044: Access denied for user: 'dbo164288558@%' to database 'db164288558' (db388.perfora.net)". Retrieved from "http://marinegouge.com/mediawiki-1.6.6/index.php?title=Main_Page"

I cannot access anything on this page. How can I fix this?

paul_jones880@yahoo.com

—12.219.78.192 03:03, 21 January 2009 (UTC)


 * Sounds like your database user's permissions got mauled. If you can't fix the permissions yourself, complain to your host. —Emufarmers(T 13:19, 21 January 2009 (UTC)

Column user_id corrupted?

 * MediaWiki version: 1.12
 * PHP version: Unsure
 * MySQL version: 5.0.45
 * URL:

—74.0.37.138 22:45, 22 January 2009 (UTC)

After much investigation is appears that the column user_id in mySQL got deleted. Now all my users can see the wiki and even anonymously edit any page they would like. But they cannot login with their user ID's and cannot register. Anyone have any idea how I can fix this? I'm not a super mySQL user so as explicit detail as possible will be greatly appreciated.

Fixed: mysql>ALTER TABLE aw_user ADD COLUMN user_id INT(5) NOT NULL PRIMARY KEY AUTO_INCREMENT;

[Solved] Database error when registered user or Admin try to modify Main page contents

 * MediaWiki version: 1.13.3
 * PHP version: 5
 * MySQL version:
 * URL: http://www.4copter.com/mediawiki

Hello, I have a quite strange problem.

When a logged registered user or logged Admin try to modify the Main page contents he receive an error message: ''Sorry! This site is experiencing technical difficulties. Try waiting a few minutes and reloading. (Can't contact the database server: Unknown error (sql.4copter.com))''

Any non logged user  can modify the main page ! Registered users and Admin when logged can access to their pages.

It is a bug !

'''If I click on the edit link on the left side of the Main page, the hyperlink is something like http://www.mysite.com/mediawiki/index.php?title=main_page&action=edit&section=1

But if I click on the "modify" tab on the top menu of the same page hyperlink is something like http://www.mysite.com/mediawiki/index.php?title=main_page&action=edit

Without the final part of link "&section=1" the page can be modified also by registred user and Admin.

Database query error after minor mysql upgrade

 * MediaWiki version: 1.10.1
 * PHP version: PHP: 5.2.0-8+etch13 (apache2handler)
 * MySQL version: 5.0.32-Debian_7etch8-log
 * URL: intranet

Hello, I have few MW installations on an intranet, after upgrading mysql from 5.0.32-7etch6 to 5.0.32-7etch8 I got all my MW failing with the same following error.

Original exception: exception 'DBQueryError' with message 'A database error has occurred Query: SELECT value,exptime FROM `objectcache` WHERE keyname='mw_ultra:messages-hash' Function: MediaWikiBagOStuff::_doquery Error: 1033 Incorrect information in file: './mw_ultra/objectcache.frm' (localhost) ' in /home/albafotonica.com/ultra/includes/Database.php:806 ...

I have no idea what happened, and could not repair the error. Fortunately I have dumped all my databases before the upgrade, dropping the MW databases and putting everything where it was solved the problem. But i still wonder what happened, I googled for the error with no luck (except same symptoms when upgrading from some mysql4 versions as the FRM format changed somehow, but its not the case). Perhaps someone can throw some light over this, I believe it can happen to many people using Debian stable, and not everyone remembers to backup before upgrading.

—IvanStepaniuk 10:30, 26 January 2009 (UTC)


 * It seems that this error is related to changes in the InnoDB (binary log sizes mismatch during upgrade?). Restoring the backup was probably the fast/safe solution but not the only one. This is not MW related, I will try to track down the problem somewhere else anyway. --IvanStepaniuk 11:47, 27 January 2009 (UTC)

My wiki is inaccesible

 * MediaWiki version: 1.13
 * PHP version: 	5.2.8
 * MySQL version: 5.0.67-community
 * URL: http://wikimh.netsons.org

Hello, probably i have modified incorrectly LocalSetting.php and so when i go to my wiki appears:

‘’ Warning: require_once(/extensions/UserRightsList/UserRightsList.php) [function.require-once]: failed to open stream: No such file or directory in /home/wikimh/public_html/LocalSettings.php on line 19

Fatal error: require_once [function.require]: Failed opening required '/extensions/UserRightsList/UserRightsList.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/wikimh/public_html/LocalSettings.php on line 19 ‘’

I don't understand what is the problem and i don't succeed in resolving it.

Thanks in advance

—Mark 54 14:10, 26 January 2009 (UTC)Mark


 * Replace line 19 with  —Emufarmers(T 20:50, 26 January 2009 (UTC)

Thanks, but now appears "line 115". What and where are the line 115 and line 19? —Mark 54 23:10, 26 January 2009 (UTC)Mark


 * What's the new error? —Emufarmers(T 04:19, 27 January 2009 (UTC)

Unfortunately i don't know. I had modified only LocalSettings.php: before there was "line 19", now there is "line 115". —Mark 54 15:25, 27 January 2009 (UTC)Mark
 * His new error says (from his url)
 * "...failed to open stream: No such file or directory in /home/wikimh/public_html/LocalSettings.php on line 115"
 * So it's basically the same error, on another line (115) referencing the same file. Doesn't really make sense, as that file is already "required" by line 19. You can probably comment that line adding # at the begin of the line 115. Perhaps you should try to recover a working copy of your LocalSettings file, or generate a new one if you are not familiar with PHP. --IvanStepaniuk 16:58, 27 January 2009 (UTC)

Thanks. How do i recover a working copy of LocalSettings.php or how do i generate a new one? Unfortunately i am not fimiliar with PHP and very inexperienced. —Mark 54 21:10, 27 January 2009 (UTC)Mark


 * Thanks, Ivan. I hate when my brain stops working. :)
 * Just remove or comment out line 115; you probably added the require_once line twice. —Emufarmers(T 00:07, 28 January 2009 (UTC)

This is my LocalSettings.php file: (My Localsettings file is in my user page) —Mark 54 14:45, 28 January 2009 (UTC)Mark
 * I have edited your question ading source tags, now i see "[...]"!, change that whole line to just $wgRemoveGroups['bureaucrat'] = false; --IvanStepaniuk 16:13, 28 January 2009 (UTC)

I decide to write [...] not to write the complete user rights' list, but [...] there isn't in my localsettings.php; so in this file there isn't ***. Please, don't consider *** and [...]. —Mark 54 18:52, 28 January 2009 (UTC)Mark


 * Mark, it is very difficult to tell if there is an error in what you have posted, try to post your file again (perhaps in your user page instead, not here), and do not modify anything but passwrords and sensitive info. Anyway, now I see your problem is the database connection, so either your user or password is incorrect, or the database is just not there. I think the best you can do if you are just starting, is to start over, carefully following the indications on the Manual:Installation guide, good luck! --IvanStepaniuk 23:43, 28 January 2009 (UTC)

I have posted my LocalSettings.php file in my user page. I have assured myself that the password and the user are correct. In my wiki's database there are many files, so starting over is a big problem for me :( How can i generate a new Localsettings.php file? Or how do i recover the files which are in my database? Thanks for your help.

PS I have tried to modify my LocalSettings.php and now there is this message: "Error, Setup.php must be included from the file scope, after DefaultSettings.php ". —Mark 54 20:44, 30 January 2009 (UTC)Mark

Error installing MySQL database

 * MediaWiki version: MediaWiki 1.13.3
 * PHP version: PHP 5.2.5
 * MySQL version: Don't know
 * URL: www.dcoxdictionary.com

How do you install the mySQL database? I get an error that says to check the database username and password. I have gone into control panel on my site and created the database, and gave myself a user and password, and then set my privileges to all. Still will not get past that point. Anybody can help me?

David Cox

—189.242.40.41 05:10, 31 January 2009 (UTC)

Recover all files in my wiki

 * MediaWiki version: 1.12.0
 * PHP version: 5.2.8
 * MySQL version: 5.0.67-community
 * URL: http://wikimh.netsons.org

Hello, i have modified incorrectly my LocalSettings.php and now my wiki is inaccesible. So i want to star over and install another wiki. How do i recover the files which are in my wiki to transfer them to another database? I don't find them in my database. Thanks in advance.

—Mark 54 09:53, 1 February 2009 (UTC)Mark

MySQL error on UserPageViewTracker

 * MediaWiki version: MediaWiki 1.13.3
 * PHP version: PHP 5.2.8-0.dotdeb.1 (cgi-fcgi)
 * MySQL version: MySQL 5.0.67-0.dotdeb.1
 * URL: www.b40317.nl/wiki

-

I followed the instructions on: http://www.mediawiki.org/wiki/Extension:UserPageViewTracker

All went well and a table user_page_views was created. It all went wrong when I ran "UserPageHits.sql" as prescribed. Upon doing so I received an error as follows: #1142 - CREATE VIEW command denied to user 'bnl'@'localhost' for table 'user_page_hits'

The UserPageHits.sql is copy pasted as follows:

CREATE VIEW `user_page_hits` AS SELECT `u`.`user_name` AS `user_name`, `u`.`user_real_name` AS `user_real_name`, `p`.`page_namespace` AS `page_namespace`, `p`.`page_title` AS `page_title`, `v`.`hits` AS `hits`, `v`.`last` AS `last` FROM ((`user` `u` JOIN `page` `p`) JOIN `user_page_views` `v`) WHERE ((`u`.`user_id` = `v`.`user_id`) AND (`p`.`page_id` = `v`.`page_id`)) ORDER BY `u`.`user_id`,`v`.`hits` DESC;

Can anyone help me out what I have to do differently? Cheers.

Menno

—82.217.71.172 21:42, 5 February 2009 (UTC)
 * It is possible that your database user does not have the CREATE VIEW privilege granted, did you try to grant all privileges for your user for this database?

--IvanStepaniuk 10:07, 6 February 2009 (UTC)

Cheers Ivan, Can't do apparently; when I run your advice, I get the following feed back: #1044 - Access denied for user 'bnl'@'localhost' to database 'my-mediawiki-database-name'

Menno

--82.217.71.172 09:20, 7 February 2009 (UTC)

Wiki wont load

 * MediaWiki version: 1.11.0
 * PHP version: 5.2.6
 * MySQL version: 4.1.22
 * URL: http://seekcreativity.com/splash/wiki/

I just went to my wiki one day and I saw this... I used InnoDB

MediaWiki internal error.

Original exception: exception 'DBQueryError' with message 'A database error has occurred Query: SELECT value,exptime FROM `wiki_objectcache` WHERE keyname='seekcrea_wiki1-wiki_:messages-hash' Function: MediaWikiBagOStuff::_doquery Error: 1146 Table 'seekcrea_wiki1.wiki_objectcache' doesn't exist (localhost) ' in /home/seekcrea/public_html/splash/wiki/includes/Database.php:824 Stack trace:
 * 1) 0 /home/seekcrea/public_html/splash/wiki/includes/Database.php(779): Database->reportQueryError('Table 'seekcrea...', 1146, 'SELECT value,ex...', 'MediaWikiBagOSt...', false)
 * 2) 1 /home/seekcrea/public_html/splash/wiki/includes/BagOStuff.php(405): Database->query('SELECT value,ex...', 'MediaWikiBagOSt...')
 * 3) 2 /home/seekcrea/public_html/splash/wiki/includes/BagOStuff.php(300): MediaWikiBagOStuff->_doquery('SELECT value,ex...')
 * 4) 3 /home/seekcrea/public_html/splash/wiki/includes/BagOStuff.php(234): SqlBagOStuff->_query('SELECT value,ex...', 'seekcrea_wiki1-...')
 * 5) 4 /home/seekcrea/public_html/splash/wiki/includes/MessageCache.php(205): SqlBagOStuff->get('seekcrea_wiki1-...')
 * 6) 5 /home/seekcrea/public_html/splash/wiki/includes/MessageCache.php(441): MessageCache->load
 * 7) 6 /home/seekcrea/public_html/splash/wiki/includes/GlobalFunctions.php(467): MessageCache->get('mainpage', true, true)
 * 8) 7 /home/seekcrea/public_html/splash/wiki/includes/GlobalFunctions.php(421): wfMsgGetKey('mainpage', true, true, true)
 * 9) 8 /home/seekcrea/public_html/splash/wiki/includes/GlobalFunctions.php(368): wfMsgReal('mainpage', Array, true, true)
 * 10) 9 /home/seekcrea/public_html/splash/wiki/includes/Title.php(268): wfMsgForContent('mainpage')
 * 11) 10 /home/seekcrea/public_html/splash/wiki/includes/Wiki.php(92): Title::newMainPage
 * 12) 11 /home/seekcrea/public_html/splash/wiki/index.php(58): MediaWiki->checkInitialQueries(NULL, 'view', Object(StubObject), Object(WebRequest), Object(StubContLang))
 * 13) 12 {main}

Exception caught inside exception handler: exception 'DBUnexpectedError' with message 'Error in fetchObject: Table 'seekcrea_wiki1.wiki_page' doesn't exist (localhost)' in /home/seekcrea/public_html/splash/wiki/includes/Database.php:953 Stack trace:
 * 1) 0 /home/seekcrea/public_html/splash/wiki/includes/MessageCache.php(314): Database->fetchObject(false)
 * 2) 1 /home/seekcrea/public_html/splash/wiki/includes/MessageCache.php(251): MessageCache->loadFromDB
 * 3) 2 /home/seekcrea/public_html/splash/wiki/includes/MessageCache.php(441): MessageCache->load
 * 4) 3 /home/seekcrea/public_html/splash/wiki/includes/GlobalFunctions.php(467): MessageCache->get('databaseerror', true, false)
 * 5) 4 /home/seekcrea/public_html/splash/wiki/includes/GlobalFunctions.php(421): wfMsgGetKey('databaseerror', true, false, true)
 * 6) 5 /home/seekcrea/public_html/splash/wiki/includes/Exception.php(23): wfMsgReal('databaseerror', Array)
 * 7) 6 /home/seekcrea/public_html/splash/wiki/includes/Database.php(276): MWException->msg('databaseerror', 'Database error')
 * 8) 7 /home/seekcrea/public_html/splash/wiki/includes/Exception.php(125): DBQueryError->getPageTitle
 * 9) 8 /home/seekcrea/public_html/splash/wiki/includes/Exception.php(88): MWException->htmlHeader
 * 10) 9 /home/seekcrea/public_html/splash/wiki/includes/Exception.php(111): MWException->reportHTML
 * 11) 10 /home/seekcrea/public_html/splash/wiki/includes/Exception.php(191): MWException->report
 * 12) 11 /home/seekcrea/public_html/splash/wiki/includes/Exception.php(225): wfReportException(Object(DBQueryError))
 * 13) 12 [internal function]: wfExceptionHandler(Object(DBQueryError))
 * 14) 13 {main}

—Chavoc 22:23, 9 February 2009 (UTC)


 * Make sure that you're connecting to the right database, and that you're using the right database prefix. If you are, then you're missing some tables, and will need to restore from a backup. —Emufarmers(T 21:46, 10 February 2009 (UTC)

While none of that information has changed... I have noticed errors when viewing the tables with phpMyAdmin... All except the search index seem to be broken. This exact same thing has happened to annother media wiki of mine on annother server, with a completly different set up. Unfortunatly my backup was lost when I had a personal harddrive failure (didnt backup the backup.) Why might this have happened ONLY to 2 media wiki databases, when all the other databases on the mysql servers stay fine? Are there any tools out there that I could run that can try and recover corrupt InnoDB tables? --Chavoc 00:33, 11 February 2009 (UTC)


 * I would guess that the other databases on the servers aren't using InnoDB. You could try repairing the tables in phpMyAdmin; you could also dump, drop, and recreate the tables; and, of course, you could just ask your host for a backup (whether or not they'll have one to give you depends on the host). —Emufarmers(T 12:31, 11 February 2009 (UTC)

ipblocks table corrupt?

 * MediaWiki version: 1.12
 * PHP version: 5.2.4
 * MySQL version: N/A
 * Postgresql version: 8.3.1
 * URL: N/A (intranet)

I receive the following message when trying to describe table ipblocks "ERROR: expected "[" to start datum, but got "4 [ 1 0 0 0 ]})}"; length = 0".

The reason I noticed this is because database dumps are now failing.

SAMPLE COMMANDS & OUTPUT

 * "mediawiki=# \d mediawiki.ipblocks
 * ERROR: expected "[" to start datum, but got "4 [ 1 0 0 0 ]})}"; length = 0
 * mediawiki=# select * from mediawiki.ipblocks;
 * ipb_id | ipb_address | ipb_user | ipb_by | ipb_reason | ipb_timestamp | ipb_auto | ipb_anon_only | ipb_create_account | ipb_enable_autoblock | ipb_expiry | ipb_range_start | ipb_range_end | ipb_deleted | ipb_block_email"


 * "/usr/local/pgsql/bin/pg_dump mediawiki -v -U postgres -f mediawiki_dump.sql
 * pg_dump: finding default expressions of table "ipblocks"
 * pg_dump: SQL command failed
 * pg_dump: Error message from server: ERROR: expected "[" to start datum, but got "4 [ 1 0 0 0 ]})}"; length = 0
 * pg_dump: The command was: SELECT tableoid, oid, adnum, pg_catalog.pg_get_expr(adbin, adrelid) AS adsrc FROM pg_catalog.pg_attrdef WHERE adrelid = '16637'::pg_catalog.oid
 * pg_dump: *** aborted because of error"
 * pg_dump: Error message from server: ERROR: expected "[" to start datum, but got "4 [ 1 0 0 0 ]})}"; length = 0
 * pg_dump: The command was: SELECT tableoid, oid, adnum, pg_catalog.pg_get_expr(adbin, adrelid) AS adsrc FROM pg_catalog.pg_attrdef WHERE adrelid = '16637'::pg_catalog.oid
 * pg_dump: *** aborted because of error"


 * Any ideas on how to fix this would be appreciated.

—216.187.127.35 16:18, 11 February 2009 (UTC) jdext

RESOLVED: Issue no longer encountered after restarting postgresql.


 * MediaWiki version: 1.13.2
 * PHP version: 5.2.8
 * MySQL version: - using postgresql 8.3
 * URL:

I am trying to restore from a previous backup. After I restore the database in Postgres and try to connect to my wiki, I receive the following error:

Could not determine the numeric version from !

I am clueless whats going wrong. Please help.

—122.166.21.40 06:54, 17 February 2009 (UTC)

Sorry! This site is experiencing technical difficulties.
I get this error when editing any page. But saving a new page is functional.


 * (sitename) has a problem

Sorry! This site is experiencing technical difficulties.

Try waiting a few minutes and reloading.

(Can't contact the database server: Unknown error (mysql6.000webhost.com))

Can any one please help?

Answer: there is a file in the main folder called 'LocalSettings.php'. This file contains your database username and password information. Check to make sure the credentials are correct - this solved my problem. I had a bad password.

Can't contact the database server: Unknown error, Technical Problem
When i try editing any page by editing section wise, i get he following error
 * MediaWiki version: 1.13.4
 * PHP version: 5
 * MySQL version:
 * URL:

******* (mysite) has a problem

Sorry! This site is experiencing technical difficulties.

Try waiting a few minutes and reloading.

(Can't contact the database server: Unknown error (mysql6.000webhost.com)

—58.27.155.168 18:10, 17 February 2009 (UTC)Jawad Ahmed

[SOLVED] Articles content location for new developments

 * MediaWiki version: 1.10.0
 * PHP version: 5
 * MySQL version: 5.0.27
 * URL: localhost

I'm looking for the articles content, where they're phisically stored. I would like to reach them with some php code, to develop my own pages, for my company.

I've been trying for days to find them in the database (with the blob fields) or in some obscure text file within the mediawiki folder, but nothing to do.

Can anyone help ? Thanks a lot !

Edit : OK, found it. PHPMyAdmin just can't display the BLOB fields properly. I used the MySQL Query Browser Tool

—138.102.135.242 09:42, 20 February 2009 (UTC)