Why Convert Spreadsheets to MySQL?
Spreadsheets are the universal data format for non-technical users, but they don't scale: no concurrent access, no real querying, no relationships, no transaction safety. Moving spreadsheet data into MySQL unlocks SQL queries, joins with other tables, indexing for fast lookups, and integration with web applications. The standard workflow is: start in Excel/Google Sheets, export to CSV, then import into MySQL — and this tool is the middle step.
How Type Inference Works
The tool scans all values in each column and picks the widest MySQL type that fits: INT for whole numbers, DECIMAL for decimals, BOOLEAN for 0/1 or true/false, DATE for date-only values, DATETIME for date+time, and VARCHAR (with appropriate length) or TEXT for everything else. The inference uses the entire column, not just the first row, so the type is set to fit the largest value found. You can override any type by editing the output SQL before running it.
Batch Inserts for Performance
Each INSERT statement can contain multiple rows, which dramatically speeds up imports. A 10,000-row file becomes 100 INSERT statements at batch size 100, instead of 10,000 individual statements. MySQL parses and executes batch inserts much faster. The default batch size of 100 is a good balance between file size and performance — increase to 500 or 1000 for very large files on a fast local connection.
Safe Re-runs
The generated CREATE TABLE uses IF NOT EXISTS, so you can re-run the script without errors if the table already exists. To force a re-import, drop the table first with DROP TABLE my_table; or use a different table name. The INSERT statements are written to handle all common data types: numbers, strings, dates, NULLs, and properly escaped quotes.