Hi all,

I need to import a database (currently in excel) to Mysql. I searched a little and found out that CSV files can be imported. However, there is a problem that I am facing. The delimiter for fields in a CSV is a ',' obviously. But many of the fields in my excel database are longtext which have commas.

I'd really appreciate if somebody could tell me how I can resolve this problem and import the data seamlessly without having to enter a 14 Mb file manually.

Thanks

mOrph

on the longtext fields use quotes

1, 7, "allow commas, sample"

on the longtext fields use quotes

1, 7, "allow commas, sample"

thanx mate

on the longtext fields use quotes

1, 7, "allow commas, sample"

I tried using quotes the way you gave an example but the following problem occurs:

If i use the same database without the quotes, I am able to all the data although the delimiting of the fields is incorrect as previously mentioned.

But if I try to put the longtext field in quotes, the query does not run. I get an error saying that the first field is not an appropriate data type. which is weird coz the first field is just a int code

Is there any other way you can help me in please

Thanks mate

did you try to add these switches?

--fields-optionally-enclosed-by=""" --fields-terminated-by=, --lines-terminated-by="\r\n"

you might only need the first, just depends on what os you are on

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.