I managed to download and extract an osm-file into a mysql-database, like:
osmosis --read-xml myfile.osm --write-apidb dbType="mysql" host="localhost" database="osm" user="osm"
What I now need is a way to get only cities and their streets into the database and query them. So how do I limit the data passed from the osm-file to the database to cities and streets? I don't need any additional data.
I do not want to use any only APIs or services.
Osmosis supports so-called data manipulation tasks which can be used to filter for specific data. In order to get only cities and streets it should be sufficient to filter for both the place and highway tags (nodes as well as areas). The required parameters seem to be
--tf accept-ways place=* --tf accept-nodes place=* --tf accept-ways highway=* --tf accept-nodes highway=*
but I never used osmosis myself.