Meniu

Cum importi baza de date Wikipedia pentru uz personal sau utilizare offline

Wikipedia ofera si pune la dispozitia utilizatorilor interesati copii gratuite al continutului. Aceste baze de date pot fi folosite pentru oglindire, uz personal, backup - uri informale, utilizare offline sau interogari de baze de date. Tot continutul text este multi-licentiat sub 3.0 licenta Creative Commons cu atribuire si distribuire in conditii identice (CC-BY-SA) si GNU Free Documentation License (GFDL). Imagini si alte fisiere sunt disponibile in termeni diferiti , asa cum este detaliat in paginile lor descriere.

Executa in terminal:

wget http://dumps.wikimedia.org/enwiki/latest/enwiki-latest-page.sql.gz
wget http://dumps.wikimedia.org/enwiki/latest/enwiki-latest-category.sql.gz
wget http://dumps.wikimedia.org/enwiki/latest/enwiki-latest-categorylinks.sql.gz
wget http://dumps.wikimedia.org/enwiki/latest/enwiki-latest-redirect.sql.gz
wget http://dumps.wikimedia.org/enwiki/latest/enwiki-latest-pagelinks.sql.gz
wget http://dumps.wikimedia.org/enwiki/latest/enwiki-latest-langlinks.sql.gz

gzip -d enwiki-latest-page.sql.gz
gzip -d enwiki-latest-category.sql.gz
gzip -d enwiki-latest-categorylinks.sql.gz
gzip -d enwiki-latest-redirect.sql.gz
gzip -d enwiki-latest-pagelinks.sql.gz
gzip -d enwiki-latest-langlinks.sql.gz

# Don't need this if MySQL is configured correctly.
# SET GLOBAL innodb_file_per_table = 1;
# SET GLOBAL general_log = 'OFF';
# SET FOREIGN_KEY_CHECKS=1;
# SET GLOBAL character_set_server = utf8mb4;
# SET NAMES utf8mb4;

CREATE DATABASE wiki_en; USE wiki_en;

# Don't need this if MySQL is configured correctly.
# ALTER DATABASE wiki_en CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci;

mysql -u root -p wiki_en < enwiki-latest-page.sql
mysql -u root -p wiki_en < enwiki-latest-redirect.sql
mysql -u root -p wiki_en < enwiki-latest-category.sql
mysql -u root -p wiki_en < enwiki-latest-categorylinks.sql
mysql -u root -p wiki_en < enwiki-latest-pagelinks.sql
mysql -u root -p wiki_en < enwiki-latest-langlinks.sql

# Indicative filesizes:
# -rw-r--r-- 1 root   root    35G Jun  2 07:01 enwiki-latest-pagelinks.sql
# -rw-r--r-- 1 root   root    13G Jun  2 07:45 enwiki-latest-categorylinks.sql
# -rw-r--r-- 1 root   root   4.3G Jun  2 11:08 enwiki-latest-page.sql
# -rw-r--r-- 1 root   root   900M Jun  2 11:03 enwiki-latest-langlinks.sql
# -rw-r--r-- 1 root   root   378M Jun  2 11:10 enwiki-latest-redirect.sql
# -rw-r--r-- 1 root   root   117M Jun  2 11:03 enwiki-latest-category.sql

Andreea

"Rome wasn't built in a day" !
  • | 120 articole

Nici un comentariu inca. Fii primul!
  • powered by Verysign