Page 1 of 1
MySQL tool to convert .CSV to SQL statement
Posted: Fri May 28, 2004 2:38 pm
by ljCharlie
Anyone know a tool that will convert a .csv file or an Excel data into a SQL statement file? I found a tool that will convert a .mdb but I want to convert an Excel document or .csv file format.
Any help is grateful!
ljCharlie
Posted: Fri May 28, 2004 2:45 pm
by Weirdan
mysqlimport:
http://dev.mysql.com/doc/mysql/en/mysqlimport.html
LOAD DATA INFILE sql statement:
http://dev.mysql.com/doc/mysql/en/LOAD_DATA.html
then you can mysqldump (
http://dev.mysql.com/doc/mysql/en/mysqldump.html) it

Why would you need to convert csv to sql statements? What the point of such a conversion if you can directly import csv into your database (I'm pretty sure there are tools for other dbs like mysqlimport for MySQL).
Posted: Fri May 28, 2004 2:53 pm
by McGruff
Also, phpMyadmin (sorry no bookmarks right now - google it down) makes it very easy to import csv to mysql.
Posted: Fri May 28, 2004 2:53 pm
by ljCharlie
Many thanks for your response. The reason I need that conversion utility is that the web host I'm working with don't allow load .csv file directly into their MySQL database. They only allow SQL file.
Anyway, I'll your links some clicking and reading.
ljCharlie