export flat file db into mysql?

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Hi all, I know this can be done, but I just can't seem to find a way to  
do it (that I can use myself, or understand).

I use Mac and I've got some databases on my hosting company's MySql  
server that I use. I would like to take a database that's on my website  
and change it over to use the MySql database. It's currently using a  
flat file with pipes (|) to delineate each field.

The "converters" I've found online are all for Windows, and the one that  
I found which would run on Mac, I just can't get it to work. For some  
reason it won't connect to the server. It's called Navicat.

I do have PhpMyAdmin set up (version 2.5.5), but I can't find any way to  
do this.

This database I've got has grown quite huge, and putting all of the info  
in by hand would take a very long time. I know there's got to be a way  
to do it using a Php script that I can install on my site. I just  
haven't had success in finding the right script.

Does anyone know of something that might help? (Keep in mind, I'm not a  
programmer, though I can install Php scripts just fine; and I don't have  
full access to the MySql server, just through PhpMyAdmin)

Thank you very much. :)

Re: export flat file db into mysql?

Log into mysql via the command prompt (shell, or whatever the mac has).

You want to use the LOAD DATA statement


Re: export flat file db into mysql?

Sorry, just read, "I don't have full access to the MySql server, just
through PhpMyAdmin".

Actually you can do it through phpmyadmin, just hope it doesnt time out.

Re: export flat file db into mysql?

Cynthia wrote:

Quoted text here. Click to load it

phpMyAdmin might be helpful in this case. Create a table with the
column order you have in your text file. Then, in the "Structure"
section of the table, open the link titled "Insert data from a text
file into the table"; it's at the very bottom of the page. Here you can
upload your file from your local computer and select how the text in it
should be treated.

From what I can tell, this function acts like the LOAD DATA or LOAD
DATA LOCAL methods from from command line as mentioned in a previous
post in this thread.

Kim André Akerø
- kimandre@NOSPAMbetadome.com
(remove NOSPAM to contact me directly)

Site Timeline