I want to import CSV data into mysql database.
Additionally, I dont want to create a table first and then import. That means, if my csv file name is test.csv, and its contents are like
customer_ID,name
10000000,name1
10000001,name2
I should be execute
mysql> use database {database_name}
mysql> {some_command} test.csv
And I should be able to create a table with name test and it having headers customer_ID and name and it should be populated according to contents of test.csv. Specifically some_command is the magic bullet I am looking for.
Any idea how this can be done in MySQL. While I searched I did not find a way to import CSV data without creating a table first.
PhpmyadminWhich provides the same functionality as you require