MySQL Forums
Forum List  »  MySQL for Excel

Re: How to upload Excel spreadsheet to MySQL database
Posted by: Erik Haselhofer
Date: July 20, 2011 03:41PM

It should be as clean as this.

1. Save the worksheet as a .CSV file.
2. Import that into the table which I assume Workbench can handle. I should probably spend more time with it but I was, for whatever reason, never that comfortable with it.

> Should I build a column as a place holder in Excel
> to hold an incremented Id number per data row that
> will upload to MySQL?

You can but you don't have to. You can basically do it as listed below, and, well, a couple more.

Key in Excel

Id field at the end of the table and let it populate on the load

Add the ID after you've loaded the data with an ALTER TABLE statement.

alter table tableName add id int not null auto_increment primary key.

This assumes you want to start at 1 and increment from there.

Options: ReplyQuote

Written By
Re: How to upload Excel spreadsheet to MySQL database
July 20, 2011 03:41PM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.