Importing Excel sheet into phpMyAdmin

66,181
  1. Your file should be look like this(decimal fields are of general type):

xlssheet

  1. Save as CSV. File will be probably saved with ; separated

This is for new table:

  1. Open phpMyAdmin, choose your database, click to import and select file to upload
  2. Change format to CSV if there is not selected
  3. Change in format specific options - columns separated with: ;
  4. Be sure that checkbox (The first line of the file contains the table column names (if this is unchecked, the first line will become part of the data)) is SELECTED
  5. Click Go
  6. New table will be created with the structure according to the forst line in CSV.

This is for existing table:

  1. Open phpMyAdmin, choose your database, CHOOSE YOUR TABLE which match the structure of imported file, click to import and select file to upload
  2. Change format to CSV if there is not selected
  3. Change in format specific options - columns separated with: ;
  4. Change skip number of queries to 1 (this will skip the first line with column names)
  5. Click Go
  6. Selected table wich has the same structure as CSV will be updated and rows in CSV inserted.
Share:
66,181
Dannys
Author by

Dannys

Junior Software Engineer at Sage UKI for the past 2 years, working on lots of different projects. I spend most of my time writing C++/winAPI, but also work on projects that include .NET Core, WPF, WinForms and Android/Java.

Updated on August 27, 2020

Comments

  • Dannys
    Dannys over 3 years

    I'm currently playing around with phpMyAdmin and I have encountered a problem. When importing my CSV into phpMyAdmin it's rounding the numbers. I have set the column to be a float and the column in Excel to be a Number (Also tried text/General) to no avail. Has anyone else encountered this issue and found a viable work-around?

    A second question, is it possible for me to upload the CSV file so that it matches the column names in phpMyAdmin to Excel column names and enters the data in the correct column?