Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what table in mediawiki Database hold the page content

Tags:

mediawiki

What table in the mediawiki database holds the page content? I want to access the mediawiki's database directly.

like image 387
jojo Avatar asked Dec 28 '22 22:12

jojo


2 Answers

You can take a look at the database layout of MediaWiki. The page content is located in the table text (on PostgreSQL it seems to be pagecontent)

like image 98
halfdan Avatar answered Feb 11 '23 18:02

halfdan


I recently had a mediawiki installation go so wrong I needed to retrieve page content directly from the database. Below is the MYSQL statement I was able to use to retrieve the page content with.

SELECT  `old_text` 
FROM  `mw_text` 
WHERE  `old_id` 
IN (

    SELECT  `rev_text_id` 
    FROM  `mw_revision` 
    LEFT JOIN  `mw_page` ON  `page_latest` =  `rev_id` 
    WHERE  `page_title` LIKE (
         '%title_of_the_page%'
    )
)

Note: my table prefix is mw_ yours will probably be different

like image 36
willcwf Avatar answered Feb 11 '23 17:02

willcwf