faqts : Computers : Databases : MySQL : Common Problems : Importing Data

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

72 of 82 people (88%) answered Yes
Recently 10 of 10 people (100%) answered Yes

Entry

How can I move a database from Access 2000 to MySQL?
How to solve "division by zero" error while importing data from a text file using LOAD DATA INFILE?

Jan 27th, 2000 13:27
j urban, hungry monkey, Nathan Wallace, Ankur Patel,


This information applies to a single table.

1) Export data from Access 2000 to a delimited text file.
2) Create an appropriate table on the MySQL server.
3) Import the delimited text file into the MySQL table.


1. Open Access 2000
2. Export the table to a comma or tab-delimited text file
3. Close Access
4. Login to MySQL Server
5. Change to desired database or CREATE DATABASE
6. Create the appropriate MySQL table structure using CREATE TABLE
7. Use the LOAD DATA INFILE command to load the data

The LOAD DATA statement might look like this (comma-delimited):

 mysql> load data infile 'filename' FIELDS TERMINATED BY ','

See the MySQL Manual:
 http://www.mysql.com/Manual/manual.html#Compatibility
 http://www.mysql.com/Manual/manual.html#CREATE_DATABASE 
 http://www.mysql.com/Manual/manual.html#CREATE_TABLE
 http://www.mysql.com/Manual/manual.html#mysqlimport
 http://www.mysql.com/Manual/manual.html#LOAD_DATA