Load csv into MySQL database programmatically
What you want is nearly impossible, no one can know if you want to import '1' as a characters string, n decimal integer, a base-2 integer, an hex integer, a float, a blob, a "boolean", ...

You can try heuristic programs, or import them all as strings and run an analysis program like SELECT... ANALYZE TABLE();. It would be easier if the csv had the datatypes as an information.

Regarding programs that create the table (with chars) based on the list of columns, that is easier to find (GUI) and program. 

Here it is one in bash as an example.