I don't
understand the "Expected file stream, got SQL connection?"
error ... surely an SQL connection in this case is a good thing?
You need to put the --output:mysql *before* the --format=sql:1.4.
Ah, OK! Thank you! That gets it started.
Can I please make a suggestion (for the README.txt, not mwdumper.jar) ?
The commands are described in the abstract, but converting from the
abstract to a concrete command-line is non-trivial due to:
* Different call syntax required when using the JDBC driver.
* Order of args matters when using both --output and --format.
* The ampersand in the username/password mysql URI being interpreted
as backgrounding unless escaped.
Therefore it would really help to include a concrete working example
of running mwdumper in this way in the README.txt. I would suggest
adding something like the following:
========================================================
Example of using mwdumper with a direct connection to MySQL:
/usr/java/jre1.5.0_05/bin/java -Xmx200M -server -classpath
mysql-connector-java-3.1.11/mysql-connector-java-3.1.11-bin.jar:mwdumper.jar
org.mediawiki.dumper.Dumper
--output=mysql://127.0.0.1/testwiki?user=wiki\&password=wiki
--format=sql:1.4 20051020_pages_articles.xml.bz2
Notes:
* You will need the mysql-connector JDBC driver (can be downloaded
from mysql's website).
* The JRE does not allow you to mix the -jar and -classpath arguments
(hence the different command structure).
* The --output argument must before the --format argument.
* The ampersand in the MySQL URI must be escaped on Unix-like systems.
========================================================
Also, I encountered the following the problem/error when importing in this way:
========================================================
ludo:/home/nickj/wikipedia# /usr/java/jre1.5.0_05/bin/java -Xmx200M
-server -classpath
mysql-connector-java-3.1.11/mysql-connector-java-3.1.11-bin.jar:mwdumper.jar
org.mediawiki.dumper.Dumper
--output=mysql://127.0.0.1/testwiki?user=wiki\&password=wiki
--format=sql:1.4 20051020_pages_articles.xml.bz2
1,000 pages (58.661/sec), 1,000 revs (58.661/sec)
2,000 pages (76.502/sec), 2,000 revs (76.502/sec)
3,000 pages (88.556/sec), 3,000 revs (88.556/sec)
4,000 pages (89.71/sec), 4,000 revs (89.71/sec)
5,000 pages (90.874/sec), 5,000 revs (90.874/sec)
Exception in thread "main" java.io.IOException: java.sql.SQLException:
Not a valid escape sequence: {| border=\"1\" cellpadding=\"2\"
cellspacing=\"0\" style=\"float:right; empty-cells:show;
margin-left:1em; margin-bottom:0,5em; background:#DEFFAD;\"\n!
align=\"center\" colspan=\"2\" | Statistics\n|----
bgcolor=\"#FFFFFF\"\n| [[Peripheries of Greece|Periphery]]:|| [[South
Aegean]]\n|---- bgcolor=\"#FFFFFF\"\n| Capital: ||
[[Ermoupoli]]\n|---- bgcolor=\"#FFFFFF\"\n| Area: || 2,572 [[square
kilometre|km?]] <small>[[List of the prefectures of Greece by
area|Ranked 24th]]</small>\n|---- bgcolor=\"#FFFFFF\"\n| Elevation: ||
Lowest: [[Aegean Sea]]<br>Highest: [[Mount Zeus]] \n|----
bgcolor=\"#FFFFFF\" valign=\"top\"\n| Inhabitants: || 119,549
<small>[[List of the prefectures of Greece by population|Ranked
26th]]</small>\n|---- bgcolor=\"#FFFFFF\"\n| Population density: ||
43.23/km?<small>\'\'(2001)\'\n|---- bgcolor=\"#FFFFFF\"\n|
[[ISO
3166-2:GR|ISO 3166-2]]: || GR-82\n|---- bgcolor=\"#FFFFFF\"\n|
[[FIPS]] code: || GR49\n|---- bgcolor=\"#FFFFFF\"\n| [[License plates
in Greece|Car designation]]: || \'\'\'EM\'\'\'
(\'\'\'E\'\'\'r\'\'\'m\'\'\'oupolis)\n|----
bgcolor=\"#FFFFFF\"\n|
[[YPES|Code for the municipalities]]: || ??xx\n|----
bgcolor=\"#FFFFFF\"\n| Municipalities: || 20\n|----
bgcolor=\"#FFFFFF\"\n| Independent communes: || 11\n|----
bgcolor=\"#FFFFFF\"\n| [[Area codes in Greece|Area/distance code]]: ||
[[Greek dialing codes beginning with 228|228x0]] \n|----
bgcolor=\"#FFFFFF\"\n|[[List of postal codes in Greece|Postal code]]
|| 84x xx\n|---- bgcolor=\"#FFFFFF\"\n| Name of inhabitants: ||
Cycladean \'\'sing.\'\'<br>-s \'\'pl.\'\'\n|----
bgcolor=\"#FFFFFF\"\n| 2-letter abbreviation/HASC: ||
CY<!--\n<!--|---- bgcolor=\"#FFFFFF\"\n| Address of administration: ||
<br>Ermoupolis 841 00\n|---- bgcolor=\"#FFFFFF\"\n| Website: ||
[
http://www..gr www..gr]<br>(also in Greek)-->\n|----
bgcolor=\"#FFFFFF\"\n! colspan=\"2\" bgcolor=\"#DEFFAD\" |
Map\n|----
bgcolor=\"#FFFFFF\"\n! colspan=\"2\" align=\"center\" |
[[Image:GreeceCyclades.png|240px|Map showing Cyclades within
Greece]]\n|}__NOTOC__\n\nThe \'\'\'Cyclades\'\'\', from the
[[Greek
language|Greek]]
Κυκλάδες,
(\"circular,\" modern Greek \'\'Kykl?des\'\'; see also [[List
of
traditional Greek place names]]) form an [[island]] group south-east
of the mainland of [[Greece]]. They are a part of the [[Greek
islands|vast number of islands]] which constitute the Greek
[[archipelago]] in the [[Aegean Sea]]. The name was originally used to
indicate those islands that formed a rough circle around the sacred
island of [[Delos]] (\'\'map\'\').\n\nThe Cyclades are comprised of
around 220 islands, with the major ones being [[Amorgos]], [[Anafi]],
[[Andros|?ndros]], [[Antiparos]], [[Delos]], [[Ios]], [[Kea
(island)|K?a]], [[Kimolos]], [[Kynthos]], [[Milos|M?los]],
[[Mykonos]], [[Naxos, Greece|N?xos]], [[Paros|P?ros]],
[[Pholegandros]], [[Serifos]], [[Sifnos]], [[Sikinos]],
[[Siros|S?ros]], [[Tinos|T?nos]], and [[Santorini|Santorini (Thira)]].
\n \n\n[[Ermoupolis]], on S?ros, is the chief town and administrative
center of the group. \nThe islands are peaks of a submerged
mountainous terrain, with the exception of two [[volcano|volcanic]]
islands, [[Melos]] and Santorini (Thera). The [[climate]] is
generally dry and mild, but with the exception of Naxos the soil is
not very fertile: agricultural produce includes [[wine]], [[fruit]],
[[wheat]], [[olive oil]], and [[tobacco]]. Cooler temperatures are in
higher elevations and mainly do not receive wintry weather. In
transportation, the Cyclades is the only prefecture in Greece that is
not linked with a state-maintained highway or a highway number. All
of its roads in the island complex are secondary or provincial.\n\nThe
significant Late Neolithic and Early Bronze Age \'\'\'Cycladic
culture\'\'\' is best known for its schematic flat female idols carved
out of the islands\' pure white marble centuries before the great
Middle Bronze Age (\"[[Minoan civilization|Minoan]]\") culture arose
in Crete, to the south: these figures have been looted from burials to
satisfy a thriving Cycladic antiquities market since the early 20th
century. \n\nA distinctive Neolithic culture amalgamating Anatolian
and mainland Greek elements arose in the western Aegean before 4000
BCE, based on [[emmer wheat]] and wild-type barley, sheep and goats,
pigs, and tuna that were apparently speared from small boats (Rutter).
Excavated sites include Saliagos and Kephala (on [[Keos]]) with signs
of copper-working, Each of the small Cycladic islands could support no
more than a few thousand people, though Late Cycladic boat models show
that fifty oarsmen could be assembled from the scattered communities
(Rutter), and when the highly organized palace-culture of Crete arose,
the islands faded into insignificance, with the exception of Delos,
which retained its archaic reputation as a sanctuary through the
period of Classical Greek civilization.\n\nThe first archaeological
excavations of the 1880s were followed by systematic work by the
British School at Athens and by Christos Tsountas, who investigated
burial sites on several islands in 1898-99 and coined the term
\"Cycladic civilization\" Interest lagged, then picked up in the
mid-20th century, as collectors competed for the modern-looking
figures that seemed so similar to sculpture by [[Jean Arp]] or
[[Constantin Brancusi]]. Sites were looted and a brisk trade in
forgeries arose, but more accurate archaeology revealed the broad
outlines of a farming and seafaring culture that had immigrated from
Asia Minor \'\'ca\'\' [[5th millennium BCE|5000 BCE]]. Early Cycladic
culture evolved in three phases, between \'\'ca\'\' [[33rd century
BCE|3300]] - [[20th century BCE|2000 BCE]], when it was increasingly
swamped in the rising influence of Minoan Crete.\nThe culture of
mainland Greece contemporary with Cycladic culture is termed
[[Helladic culuture|Helladic]]. \n\nIn recent decades the Cyclades
islands have become extremely popular with [[Europe]]an and other
[[tourist]]s, and as a result there have been problems with
[[erosion]], [[pollution]], and water
shortages.\n\n<!--\n==Transportation==\n\n*[[Greece Interstate
|GR-]]\n\n==Communications==\n===[[List of radio stations in
Greece|Radio]]===\n===[[List of Greek language television
channels|Television]]===\n\n==Famous inhabitants of the Lesbos
prefecture==\n\n==Islands==\n\n==Archaeological sites==-->\n\n==Area
codes==\n\n:[[Greece dialing code 22810|22810]] - [[Syros]], including
[[Kythnos]], [[Serifos]] and [[Syros]] islands\n:[[Greece dialing code
22820|22820]] - [[Andros]]\n:[[Greece dialing code 22830|22830]] -
[[Tinos]]\n:[[Greece dialing code 22840|22840]] - [[Paros]] and
[[Sifnos]] islands\n:[[Greece dialing code 22850|22850]] - [[Amorgos]]
and [[Naxos, Greece|Naxos]] islands\n:[[Greece dialing code
22860|22860]] - [[Folegandros]], [[Ios]], [[Santorini]] and
[[Sikinos]] islands\n:[[Greece dialing code 22870|22870]] -
[[Kimolos]] and [[Milos]]\n:[[Greece dialing code 22880|22880]] -
[[Kea Island]]\n:[[Greece dialing code 22890|22890]] -
[[Mykonos]]\n\n==Municipalities and communities==\n\n{| border=\"1\"
cellpadding=\"2\" cellspacing=\"0\"\n|-
bgcolor=\"#efefef\"\n!
Municipality !! YPES code !! Seat !! Postal code !! Area code \n|-\n|
Amorgos || 3101 || [[Amorgos]] || 840 08 || 22850-2\n|-\n| Andros ||
3103 || [[Andros]] || 845 00 || 22820-2\n|-\n| Ano Syros || 3105 ||
[[Ano Syros]] || 841 00 || 22810-8\n|-\n| Drymalia || 3107 ||
[[Chalkio (Naxos), Greece|Chalkio]] || 843 02 || 22850\n|-\n|
Ermoupoli || 3109 || [[Ermoupoli]] || 841 00 || 22810-2\n|-\n|
[[Exomvourga]] || 3108 || [[Xinara]] Naxou || 842 00 || 22850-5\n|-\n|
Ios || 3112 || [[Ios]] || 840 01 || 22860-9\n|-\n| Kea || 3113 ||
[[Kea Island|Kea]] || 840 02 || 22880-2\n|-\n| Korthio || 3115 ||
[[Ormos]] Korthiou || 845 02 || 22820-6\n|-\n| Kythnos || 3117 ||
[[Kythnos]] || 840 06 || 22810-3\n|-\n| Milos || 3118 || [[Milos]] ||
848 00 || 22870-2\n|-\n| Mykonos || 3119 || [[Mykonos]] || 846 00 ||
22890-2\n|-\n| Naxos || 3120 || [[Naxos]] || 843 00 || 22850-2\n|-\n|
Paros || 3123 || [[Paros]] || 844 00 || 22840-2\n|-\n| Poseidonia ||
3124 || [[Episkopi Posidonias]] || 841 00 || 22810-4\n|-\n| Serifos ||
3125 || [[Serifos]] || 840 02 || 22810-5\n|-\n| Sifnos || 3127 ||
[[Sifnos]] || 840 03 || 22840-3\n|-\n| Thira || 3111 || [[Thira]] ||
847 00 || 22860-2\n|-\n| Tinos || 3129 || [[Tinos]] || 842 00 ||
22830-2\n|-\n| [[Ydrousa]] || 3130 || [[Gavrio]] || 845 01 ||
22820-7\n|- bgcolor=\"#efefef\"\n! Community !! YPES code !! Seat !!
Postal code !! Area code \n|-\n| Anafi || 3102 || [[Anafi]] || 840 09
|| 22860-6\n|-\n| Antiparos || 3104 || [[Antiparos]] || 840 07 ||
22840-6\n|-\n| Donoussa || 3106 || [[Donoussa]] || 843 00 ||
22850-5\n|-\n| Folegandros || 3131 || [[Folegandros]] || 840 11 ||
22860\n|-\n| Heraklia || 3110 || [[Heraklia (Cyclades),
Greece|Heraklia]] || 843 00 || 22870-7\n|-\n| Kimolos || 3114 ||
[[Kimolos]] || 840 04 || 22870-5\n|-\n| Koufonissa || 3116 ||
[[Koufonissa]] || 843 00 || 22870-7\n|-\n| Oia || 3121 || [[Oia]] ||
847 02 || 22860-7\n|-\n| Panormos || 3122 || [[Panormos]] || 842 01 ||
22830-3\n|-\n| Schoinoussa || 3128 || [[Schoinoussa]] || 843 00 ||
22870-7\n|-\n| Sikinos || 3126 || [[Sikinos]] || 840 10 ||
22860-5\n|}\n\nSee also: [[List of settlements in the Cyclades
prefecture]]\n\n==Further reading==\n*J. A. MacGillivray and R. L. N.
Barber, editors, \'\'The Prehistoric Cyclades\'\' (Edinburgh) 1984.
\n*R. L. N. Barber, \'\'The Cyclades in the Bronze Age\'\' (Iowa City)
1987.\n\n==External
links==\n\n*[http://projectsx.dartmouth.edu/classics/history/bronze_age/ind…
Jeremy B. Rutter, \"The Prehistoric Archaeology of the Aegean\" ]:
especially Lessons 2 and 4: chronology, history,
bibliography\n\n[[Category:The
Cyclades|*]]\n[[Category:Archipelagoes]]\n[[Category:Islands of
Greece]]\n[[Category:Prefectures of
Greece]]\n\n[[da:Kykladerne]]\n[[de:Kykladen]]\n[[et:K?klaadid]]\n[[el:????????]]\n[[es:C?cladas]]\n[[fr:Cyclades]]\n[[gl:C?cladas]]\n[[it:Cicladi]]\n[[la:Cycladae]]\n[[nl:Cycladen]]\n[[pl:Cyklady]]\n[[pt:C?clades]]\n[[fi:Kykladit]]\n[[sv:Kykladerna]]','the
picture of santorini is not really relevent to this
article',331014,'AlbertR','20051012000833','',0,0,0,RAND(),DATE_ADD('1970-01-01',
INTERVAL UNIX_TIMESTAMP()
SECOND)+0,'79948987999166'),(6594,0,'Casimir_IV_Jagiello','#REDIRECT
[[Casimir IV of
Poland]]\n\n','*M',0,'66.47.62.78','20020517222455','',0,1,0,RAND(),DATE_ADD('1970-01-01',
INTERVAL UNIX_TIMESTAMP()
SECOND)+0,'79979482777544'),(6595,0,'Computer_Vision','#REDIRECT
[[Computer vision]]\n','Automated conversion',0,'Conversion
script','20020225155115','',0,1,1,RAND(),DATE_ADD('1970-01-01',
INTERVAL UNIX_TIMESTAMP(
[##### NOTE: LOTS MORE LINES OF SQL IN HERE THAT HAVE BEEN REMOVED FOR
BREVITY ###### ]
the Dune saga?
*/',0,'82.20.215.163','20051013190422','',0,0,0,RAND(),DATE_ADD('1970-01-01',
INTERVAL UNIX_TIMESTAMP() SECOND)+0,'79948986809577')
at org.mediawiki.importer.XmlDumpReader.readDump(Unknown Source)
at org.mediawiki.dumper.Dumper.main(Unknown Source)
========================================================
All the best,
Nick.