GeoNames Home | Postal Codes | Download / Webservice | About 

GeoNames Forum
  [Search] Search   [Recent Topics] Recent Topics   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Import txt on mysql  XML
Forum Index -> General
Author Message

Joined: 31/05/2017 02:00:02
Messages: 1

Hello, I have the file I would like to know how to import it into a database on mysql

Joined: 11/02/2017 20:41:32
Messages: 10

Hello John

I have been doing similar.
there is no .sql file ready made for you to do this (as different users will want different things), but importing data is easy enough.

you may want to read this but replace the file name in the "LOAD DATA INFILE" parts with the extracted FR file.

MySQL WorkBench should help you do this, but it is probably possible in phpmyadmin

hope this helps


Joined: 26/09/2017 08:49:01
Messages: 2

john93 wrote:
Hello, I have the file I would like to know how to import it into a database on mysql 

Haven't seen yet but i believed the file is TAB DELIMITED.

You can import it the way you import .SQL file.

On phpMyAdmin

[list]Create a table first, the number of column must be the same with the number of column in FR.txt
You can name the column any name you want.

choose INT when the column content contains INTEGER or numbers
choose VARCHAR - VARIABLE CHARACTER - when the column content contains letters

[list]LENGTH count the max number of INTEGER or CHARACTERS.
example: Hungary = is composed of 7 characters, to be sure, make an adjustment, make it more than 7, you can use 25.

then save.

After creating the table, click your newly created table at the left bar,
click IMPORT
browse your file ex FR.txt

Format-specific options:
Columns separated with: ------- \t

\t for tab delimited, almost all file here in geonames are tab delimited. By default, the mysql is Columns separated with: , (comma), so replace it with \t

then click GO
Forum Index -> General
Go to:   
Powered by JForum 2.1.5 © JForum Team