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

I'm trying to import OSM data into MySQL and get stuck at this error. Below is the full output. This is a Windows 7 x64 machine with a fresh MySQL install. I just created a database named osm and nothing more. Then, I executed this command:

osmosis --read-pbf D:\osm\germany.osm.pbf --write-apidb dbType=mysql host=localhost database=osm user=root password=xxx

And I get the following output:

okt 09, 2012 10:13:44 PM org.openstreetmap.osmosis.core.Osmosis run
INFO: Osmosis Version 0.41
okt 09, 2012 10:13:44 PM org.openstreetmap.osmosis.core.Osmosis run
INFO: Preparing pipeline.
okt 09, 2012 10:13:44 PM org.openstreetmap.osmosis.core.Osmosis run
INFO: Launching pipeline execution.
okt 09, 2012 10:13:44 PM org.openstreetmap.osmosis.core.Osmosis run
INFO: Pipeline executing, waiting for completion.
okt 09, 2012 10:13:44 PM org.openstreetmap.osmosis.core.pipeline.common.ActiveTaskManager waitForCompletion
SEVERE: Thread for task 1-read-pbf failed
org.openstreetmap.osmosis.core.OsmosisRuntimeException: Unable to create resultset.
        at org.openstreetmap.osmosis.apidb.common.DatabaseContext.executeQuery(
        at org.openstreetmap.osmosis.apidb.v0_6.impl.SchemaVersionValidator.validateDBVersion(
        at org.openstreetmap.osmosis.apidb.v0_6.impl.SchemaVersionValidator.validateVersion(
        at org.openstreetmap.osmosis.apidb.v0_6.ApidbWriter.initialize(
        at org.openstreetmap.osmosis.apidb.v0_6.ApidbWriter.process(
        at crosby.binary.osmosis.OsmosisBinaryParser.parse(
        at crosby.binary.BinaryParser.handleBlock(
        at crosby.binary.file.FileBlock.process(
        at crosby.binary.file.BlockInputStream.process(
        at Source)
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'osm.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 Source)
        at java.lang.reflect.Constructor.newInstance(Unknown Source)
        at com.mysql.jdbc.Util.handleNewInstance(
        at com.mysql.jdbc.Util.getInstance(
        at com.mysql.jdbc.SQLError.createSQLException(
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(
        at com.mysql.jdbc.MysqlIO.sendCommand(
        at com.mysql.jdbc.MysqlIO.sqlQueryDirect(
        at com.mysql.jdbc.ConnectionImpl.execSQL(
        at com.mysql.jdbc.ConnectionImpl.execSQL(
        at com.mysql.jdbc.StatementImpl.executeQuery(
        at org.openstreetmap.osmosis.apidb.common.DatabaseContext.executeQuery(
        ... 10 more

okt 09, 2012 10:13:44 PM 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.waitForCompletion(
        at org.openstreetmap.osmosis.core.Osmosis.main(
        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(
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(
        at org.codehaus.classworlds.Launcher.main(

What did I do wrong, and what should I do?

asked 09 Oct '12, 21:18

thany's gravatar image

accept rate: 0%

I believe you need to populate the database with a schema before doing the import i.e. create appropriate tables containing appropriate fields

It looks like support for MySQL may go away at some point as Openstreetmaps is moving to PostgreSQL, so you may be better off starting with PostgreSQL anyhow.

permanent link

answered 17 Oct '12, 21:16

porjo's gravatar image

accept rate: 0%

The thing is, Postgres doesn't do very well on Windows, but Windows is the most used OS out there (whether we like it or not). I do have a linux box that I can try it on, but it's not nearly as powerful as my windows box.

Even for Portgres, the documentation is not clear on how to populate the database initially. I'm not sure what exactly to do at that point. Partly because I'm not familiar at all with Postgres (I have literally never used it), and partly because it's just not very clear to me what needs to be done exactly.

(17 Oct '12, 23:11) thany

Never used it myself, but a bit of poking on the wiki revealed that there should be something to generate the database structure in a directory named "script/contrib" with your osmosis download.


(17 Oct '12, 23:45) cartinus

Follow this question

By Email:

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



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "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:


question asked: 09 Oct '12, 21:18

question was seen: 6,362 times

last updated: 17 Oct '12, 23:45

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