MYSQL Utility

Free CSV to MYSQL Converter

Upload your CSV file and customize your table name to generate clean SQL scripts instantly.

Processing is handled instantly in-memory. No data is stored on our servers.

How to convert a CSV into SQL statements

A CSV is just rows of text; a database needs typed columns and valid syntax. This converter bridges the two by reading your header row, turning each column name into a field, and writing one statement per data row. Upload the file, name the destination table, pick the statement type, and copy the result straight into your SQL client.

Choosing the right statement type

CREATE plus INSERT is the right choice for a brand new table. It emits a CREATE TABLE definition followed by an INSERT for every row, so you can build and populate in a single paste.

INSERT only assumes the table already exists and appends your rows to it. Use it when you are topping up a table whose schema you have already tuned.

UPDATE treats the first column as the lookup key and writes the remaining columns into the SET clause. Your first column therefore needs to be something unique, such as an id or an email address.

DELETE also keys on the first column and produces one removal statement per row, which is useful for cleaning out a batch of records you have identified in a spreadsheet.

Preparing your file

Column headers become column names, so keep them short and avoid punctuation. Spaces are converted to underscores automatically. Single quotes inside your data are escaped for you, so apostrophes in names and addresses will not break the output.

Every generated column is typed as VARCHAR(255) because a CSV carries no type information. Adjust the CREATE TABLE definition before running it if you need integers, dates or decimals, and widen the length for any column holding long text.

Check the first column

UPDATE and DELETE both key on column one. If it is not unique, you will modify more rows than you intended.

Run inside a transaction

Wrap the output in BEGIN and COMMIT so a mistake halfway through can be rolled back cleanly.

Mind the row count

Thousands of individual INSERT statements run slowly. For very large files, a bulk loader such as LOAD DATA INFILE is faster.

Frequently asked questions

Does this work with PostgreSQL or SQLite?

The generated syntax is standard enough for both in most cases. VARCHAR(255) is valid in PostgreSQL, and SQLite accepts it while treating it as TEXT. Backtick-free output means there is nothing MySQL-specific to strip out.

Is my file uploaded anywhere permanent?

The file is read to produce the statements and is not retained afterwards. Even so, avoid putting genuinely sensitive production data through any online converter.

Why is every column a VARCHAR?

A CSV stores everything as text and carries no type metadata, so guessing types would introduce silent errors. Editing the CREATE TABLE line is quicker and safer than debugging a bad guess.

What if my CSV uses semicolons instead of commas?

Save or re-export it with comma separators first. Many European spreadsheet locales default to semicolons, which this parser reads as ordinary characters rather than delimiters.