How to import excel data into a MySQL Database

To import an excel sheet or CSV file into a MySQL Database, you will first need to create the database (or use an existing one) and then keep the excel sheet handy.

  1. Convert the Excel to CSV
    Open your excel file. Select the worksheet to upload to MySQL. Go to the 'File' menu >> select 'Save As'. In the formatting drop-down menu select the 'Comma Separated Values (.csv)'. Click 'OK' at any warnings you may encounter. Select a path to save the document. Each worksheet in your Excel file will need to be created separately like this.
  2. Open PHPMyAdmin
    Login to your cPanel account. Under Databases, click on the PHPMyAdmin icon.
  3. Create a new database (with tables) or select an existing one.
  4. On the left-hand column of phpMyAdmin interface, select the database or table to import to and click on the 'Import' tab on the top Right
  5. Click the 'Browse' button and select the .csv file you created on your computer. 'Format of imported file' should be CSV.Ensure that 'Fields terminated by' is set to 'comma' (,). Click the 'Go' button to start the import.
  6. One the process is done, select the database / table and click on the 'Browse' tab. You should see all the rows and data that have been imported from the .csv file.

Was this answer helpful?

 Print this Article

Powered by WHMCompleteSolution