I would like to know if there is any way to convert Excel tables to MySql. Thanks
I would like to know if there is any way to convert Excel tables to MySql. Thanks
You can do it if you have installed a program type HeidiSQL
, or directly with the PHPMyAdmin
.
You only have to convert your excel to a CSV , I recommend that you separate it by commas.
Once you have the CSV
from the programs, you can configure the characteristics of your CSV, to perform the import.
Another method to do this is with SQL, using this query
LOAD DATA INFILE 'Ruta donde tengamos el archivo csv'
INTO TABLE table donde deseemos almacenar los datos
FIELDS TERMINATED BY ','
ENCLOSED BY '"'
LINES TERMINATED BY '\n'
IGNORE 1 ROWS;
FIELDS TERMINATED BY Refers when a field has to be terminated.
ENCLOSED BY Refers when a value has to be closed.
LINES TERMINATED BY Referenced when the line of the csv file ends with a new character.
IGNORE 1 ROWS Ignore the headers of the csv file.
I hope it serves you
Good morning,
You could do it in several ways, through a programming language by opening the excel, going through its rows and columns and converting the data to the structure you want in the database.
In the official documentation of MySQL for developers you have the option from the Excel application itself to export the excel in a mysql table. I leave the link in case you are interested LINK HERE
I hope you have helped, greetings!