How to convert VARCHAR to TIMESTAMP in MySQL?

How do I convert a databse into mysql format?

  • How do I convert/import a dbf (2.4 gb) to a mysql database? I just acquired a data set that is organized as a dbf. I would like to import this into mysql. How would I do that for free? There seem to be a few 3rd party tools (which show up when I search for dbf to mysql converter) but they are not free. I also tried importing through Phpmyadmin on my personal site but the file is too large for that. Are there other ways to do this? This will be a one time thing. I am running mysql 5.1 on Windows xp.

  • Answer:

    I am no expert but I think you want to get it into CSV (one row per record, commas between fields) format. I am not sure offhand how to do this from DBF but I'd try importing it into OpenOffice or Excel and saving it back out as CSV. Then you can use the LOAD DATA LOCAL INFILE command on it.

special-k at Ask.Metafilter.Com Visit the source

Was this solution helpful to you?

Other answers

How many tables are you talking about? This may be much going to get to the neighbor's house, but you could... 1. Download Microsoft SQL Server Express Edition (free) 2. Import the .dbf to SQL Server 3. Download the ODBC driver for MySQL (free) 4. Export the SQL Server database to MySQL via the ODBC driver. I'm no MySQL guru, so there may be an easier way.

DWRoelands

Depending on how much you like or hate Perl you may wish to check out http://sqlfairy.sourceforge.net/. Also, what was the http://filext.com/file-extension/DBF created by? There are a ton of different programs which will create .dbf files.

benzenedream

there is a php extension for http://us.php.net/dbase that you could use to suck the records out of the dbf files, and then generate csv or just turn around a shove it right into mysql using php. can't microsoft access handle .dbf files? i would think microsoft foxpro could, too.

jimw

Also, what was the .dbf created by? Seems like Foxpro. jimw: Don't have access right now and I really prefer using mysql to manipulate the data so the goal is to get these data in there.

special-k

from what i understand .dbf files are a standard data table format. i would be shocked to find that mysql doesn't have a method of importing it because it's so basic, but then i know nothing abut mysql. if it's command line driven, then there should be some kind of 'import' command that will have appropriate markers to indicate what the source file is. that may work better then the admin panel described above. it should be just one (really big) table.

lester's sock puppet

i would be shocked to find that mysql doesn't have a method of importing it because it's so basic. Exactly my reason for posting here.

special-k

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.