patternsqlMinor
Best way to export excel table into MySQL db
Viewed 0 times
excelintowaymysqlexporttablebest
Problem
I'm trying to export an Excel table which contains about 400 records of HR stuff (e.g. name, surname, age, job, ecc.) into a MySQL db.
I'm actually using mysql for excel and started reading a db book, but I noticed many format issues such datetimes from trying to convert from
Best practice hints for db administration are well accepted!
I'm actually using mysql for excel and started reading a db book, but I noticed many format issues such datetimes from trying to convert from
%d/%m/%Y to %d-%m-%Y. Best practice hints for db administration are well accepted!
Solution
For 1-time:
Save as text (csv) file.
CREATE TABLE ... with the columns approximating the Excel columns.
LOAD DATA LOCAL FILE ... into that table in MySQL.
(If you need 'automation', there may be better ways.)
Save as text (csv) file.
CREATE TABLE ... with the columns approximating the Excel columns.
LOAD DATA LOCAL FILE ... into that table in MySQL.
(If you need 'automation', there may be better ways.)
Context
StackExchange Database Administrators Q#114594, answer score: 3
Revisions (0)
No revisions yet.