Importing to MySQL Workbench

Hi all,

Hope you’ve all had a good new year!

I decided to start mine off by making a database in Workbench and I can’t import into it…

So, I have a .csv file with 3 columns and 40 rows. Column 1 is auto increment.

I have attached a picture of what my records look like as this is what I have seen to do on other websites.
When I try to import it with the format in the picture, it doesn’t separate them in the workbench software. (Picture attached of that)

Does anyone know what I’m doing wrong?

Thanks,
Jack


Delete the quote in Enclose Strings in. Your data is not in quotes.

Thanks, Kevin.
I’ve removed that and I get an error: Unhandled Exception: quotechar must be set if quoting enabled

Would it be better if I enclose my text in something?

I didnt see the first image. A CSV does not start with a comma.

How do I have a space for the auto number at the start of each row without a comma?

You dont need it. Mysql handles the auto-increment, thus the Auto in auto-increment. auto = automatic

Ah right, I understood it being automatic, didn’t realise I didn’t need to put a space for it… woops! ;D Thanks, Kevin! Will have a look tomorrow!

Just tried removing the comma at the start of all the rows - no joy.
When importing the CSV file, if i put an * in the 'Enclosed strings in", it will separate the records and it looks how it is meant to look in the preview. But when I import it, it does nothing.

I’ve attached a picture of my table set up, just in case I’m making a stupid mistake.

Thanks,
Jack


id should have the auto increment (AI) option checked

Thanks [member=71845]JimL[/member] - that was my problem! I remembered to AI on my other table, just not this one!
All working now 8)

Thanks to you both! :smiley:

Jack

Sponsor our Newsletter | Privacy Policy | Terms of Service