Jump to content

Importing an .xlsx file to a MySQL Database by using phpMyAdmin


mdm37
Go to solution Solved by gizmola,

Recommended Posts

  • Solution

You can certainly convert it from Excel to csv easily enough, but you need csv to import, so if you can have that instead it saves you some complications.  The important thing with csv is that your string columns need to be surrounded by double quotes so that commas inside a string don't confuse the parsing. This also necessitates that if you have double quotes in the string, the double quotes have to be doubled in order to escape them.

 

Excel export to csv should do this for you, so ultimately it's up to you if the excel has value outside of the import, or if getting a .csv version is more trouble than it's worth.

Link to comment
Share on other sites

I would use the csv. Plus you have to look at the layout closely to be sure that it works in a database format instead of a spreadsheet one. Is the data normalized as it is now?

 

 

You can certainly convert it from Excel to csv easily enough, but you need csv to import, so if you can have that instead it saves you some complications.  The important thing with csv is that your string columns need to be surrounded by double quotes so that commas inside a string don't confuse the parsing. This also necessitates that if you have double quotes in the string, the double quotes have to be doubled in order to escape them.

 

Excel export to csv should do this for you, so ultimately it's up to you if the excel has value outside of the import, or if getting a .csv version is more trouble than it's worth.

 

Great, thank you!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.