NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

I am trying to export an OSM file to a MySQL database. The syntax am am using is:

osmosis --read-xml file="d:/geo/maniu.osm" --write-apidb populateCurrentTables=yes dbType="mysql" host="localhost" database="geo" user="root"

I get this error:

D:\Geo\osmosis\bin>osmosis --read-xml file="d:/geo/maniu.osm" --write-apidb popu lateCurrentTables=yes dbType="mysql" host="localhost" database="geo" user="root" 04.07.2012 22:32:29 org.openstreetmap.osmosis.core.Osmosis run INFO: Osmosis Version 0.40.1 04.07.2012 22:32:29 org.openstreetmap.osmosis.core.Osmosis run INFO: Preparing pipeline. 04.07.2012 22:32:29 org.openstreetmap.osmosis.core.Osmosis run INFO: Launching pipeline execution. 04.07.2012 22:32:29 org.openstreetmap.osmosis.core.Osmosis run INFO: Pipeline executing, waiting for completion. 04.07.2012 22:32:29 org.openstreetmap.osmosis.core.pipeline.common.ActiveTaskMan ager waitForCompletion SEVERE: Thread for task 1-read-xml failed org.openstreetmap.osmosis.core.OsmosisRuntimeException: Unable to create results et. at org.openstreetmap.osmosis.apidb.common.DatabaseContext.executeQuery(D atabaseContext.java:429) at org.openstreetmap.osmosis.apidb.v0_6.impl.SchemaVersionValidator.vali dateDBVersion(SchemaVersionValidator.java:82) at org.openstreetmap.osmosis.apidb.v0_6.impl.SchemaVersionValidator.vali dateVersion(SchemaVersionValidator.java:55) at org.openstreetmap.osmosis.apidb.v0_6.ApidbWriter.initialize(ApidbWrit er.java:323) at org.openstreetmap.osmosis.apidb.v0_6.ApidbWriter.process(ApidbWriter. java:1080) at org.openstreetmap.osmosis.xml.v0_6.impl.NodeElementProcessor.end(Node ElementProcessor.java:118) at org.openstreetmap.osmosis.xml.v0_6.impl.OsmHandler.endElement(OsmHand ler.java:107) at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source ) at org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unkn own Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElemen t(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContent Dispatcher.dispatch(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Un known Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Sour ce) at org.apache.xerces.jaxp.SAXParserImpl.parse(Unknown Source) at javax.xml.parsers.SAXParser.parse(Unknown Source) at org.openstreetmap.osmosis.xml.v0_6.XmlReader.run(XmlReader.java:108) at java.lang.Thread.run(Unknown Source) Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'geo .schema_migrations' doesn't exist at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Sou rce) at java.lang.reflect.Constructor.newInstance(Unknown Source) at com.mysql.jdbc.Util.handleNewInstance(Util.java:411) at com.mysql.jdbc.Util.getInstance(Util.java:386) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1052) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3609) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3541) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2002) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2163) at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2618) at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2568) at com.mysql.jdbc.StatementImpl.executeQuery(StatementImpl.java:1557) at org.openstreetmap.osmosis.apidb.common.DatabaseContext.executeQuery(D atabaseContext.java:424) ... 20 more 04.07.2012 22:32:29 org.openstreetmap.osmosis.core.Osmosis main SEVERE: Execution aborted. org.openstreetmap.osmosis.core.OsmosisRuntimeException: One or more tasks failed . at org.openstreetmap.osmosis.core.pipeline.common.Pipeline.waitForComple tion(Pipeline.java:146) at org.openstreetmap.osmosis.core.Osmosis.run(Osmosis.java:92) at org.openstreetmap.osmosis.core.Osmosis.main(Osmosis.java:37) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Laun cher.java:329) at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.jav a:239) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(La uncher.java:409) at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java: 352) at org.codehaus.classworlds.Launcher.main(Launcher.java:47)

So, am I doing something wrong? I have a database structure that I downloaded from here: http://gweb.bretth.com/apidb06-mysql-latest.sql?attredirects=0

Thank you!

asked 04 Jul '12, 20:39

Alexandru's gravatar image

Alexandru
15555
accept rate: 0%


The error message is Table 'geo.schema_migrations' doesn't exist. This is a table that contains the version information of the schema. It is important that your schema is the one that osmosis is expecting.

MySQL is no longer supported by the rails port so there is no way to get a current schema for MySQL, on the other hand you would not need it for anything. You could pass validateSchemaVersion=no to osmosis to prevent it from checking the version, however that can cause an error in the process or the result.

permanent link

answered 04 Jul '12, 21:43

Gnonthgol's gravatar image

Gnonthgol ♦
13.8k16103198
accept rate: 16%

I have the same problem. Its a brick wall for me using osmosis. I tried setting validateSchemaVersion=no and still does not work. bummer

(19 Dec '18, 19:53) Ant

@Ant: what about using PostgreSQL instead?

(20 Dec '18, 20:40) aseerel4c26 ♦

aseerel4c26 I am integrating the data into an existing mariadb database and I am more familiar with mariadb. Maybe I could go from PostgreSQL to mariadb.

(21 Dec '18, 02:10) Ant

@Ant: I'd be surprised if anyone is using the MySQL features of Osmosis now. They effectively became redundant 10 years ago & are maintained for backward compatibility. I suspect it will be difficult to find someone with contemporary knowledge, but also piggy-backing of an old question is not the way to do it.

(22 Dec '18, 22:50) SK53 ♦

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×21

question asked: 04 Jul '12, 20:39

question was seen: 22,128 times

last updated: 22 Dec '18, 22:50

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum