Free MySQL importer — no upload, no account

Convert CSV to MySQL
Ready-to-run SQL
in seconds.

Free CSV to MySQL converter. Generates CREATE TABLE and INSERT statements with utf8mb4 charset, AUTO_INCREMENT primary key, ON DUPLICATE KEY UPDATE and LOAD DATA INFILE syntax. Runs entirely in your browser.

Your data never leaves your browser
utf8mb4 charset
AUTO_INCREMENT PK
Copy to clipboard
Always free
CSV to MySQL Converter  100% client-side
Drop your CSV file here
MySQL column types inferred automatically — TINYINT, INT, BIGINT, VARCHAR, DATETIME…
 MySQL SQL generated

      
MySQL-specific features

What makes this different from the generic CSV to SQL converter.

utf8mb4 + InnoDB
CREATE TABLE uses ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci — the correct charset for emoji, multilingual data and full Unicode support in modern MySQL.
AUTO_INCREMENT id
Optionally adds an id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY column as the first column — the standard MySQL primary key pattern for most tables.
ON DUPLICATE KEY UPDATE
Generates MySQL's upsert syntax — inserts new rows and updates existing ones on key collision. Ideal for incremental data loads where the same CSV may be re-imported with updated values.
INSERT IGNORE
Uses INSERT IGNORE to silently skip rows that violate a UNIQUE constraint — no error, no transaction rollback. For idempotent imports where duplicates should be discarded.
LOAD DATA INFILE
Generates the native MySQL bulk import command — up to 20x faster than INSERT for large files. Requires the CSV file to be on the MySQL server filesystem. Includes FIELDS TERMINATED BY and IGNORE 1 ROWS clauses.
MySQL type inference
Detects TINYINT, SMALLINT, MEDIUMINT, INT, BIGINT, DECIMAL(15,6), DATE, DATETIME, VARCHAR(n), TEXT and MEDIUMTEXT — using MySQL's exact type ranges, not generic SQL types.
How to import CSV into MySQL

Three methods — from fastest to most compatible.

1
LOAD DATA INFILE (fastest)

The fastest method for large files. Select LOAD DATA INFILE mode, download the .sql file, place the CSV on the MySQL server, update the file path in the SQL, and run it. Requires the FILE privilege: GRANT FILE ON *.* TO 'user'@'localhost';

2
mysql CLI with .sql file

Select batch INSERT mode, download the .sql file and run from the command line: mysql -u username -p database_name < file.sql. Works on any server without special privileges. Best for files under 100k rows.

3
Copy into MySQL Workbench or phpMyAdmin

For small datasets, copy the generated SQL to clipboard and paste it directly into MySQL Workbench's query window or phpMyAdmin's SQL tab. Click Execute. No file transfer needed — the SQL runs immediately against the selected database.

INSERT vs LOAD DATA INFILE — which to choose?

Understanding MySQL's two bulk import strategies.

Batch INSERT is the most portable option. It works from any client — the mysql CLI, MySQL Workbench, phpMyAdmin, or any programming language — without special server privileges. Performance can be further improved by wrapping the INSERTs in a transaction: START TRANSACTION; INSERT...; COMMIT;. Typically handles 10,000–50,000 rows per second.

LOAD DATA INFILE is MySQL's native bulk loader — it reads the CSV file directly from the server filesystem and bypasses the SQL parser for individual rows. This makes it 5–20x faster than INSERT for the same data, capable of loading millions of rows per second. The trade-off is that it requires the FILE privilege and the CSV file must be accessible from the MySQL server host — which is not always possible with managed databases (AWS RDS, Google Cloud SQL, PlanetScale).

When do you need CSV to MySQL conversion?

Common database workflows that start with a CSV file.

Seeding development databases

Converting a CSV sample dataset to MySQL INSERT statements is the standard way to populate a fresh database schema with realistic test data for development and staging environments.

E-commerce and CMS data migration

Product catalogs, customer lists and order history exported from Shopify, WooCommerce or other platforms as CSV are converted to MySQL INSERT statements for importing into a custom database or a different platform.

Incremental data loads with upsert

Using ON DUPLICATE KEY UPDATE, a CSV file can be re-imported to update existing records and insert new ones in a single operation — without deleting and recreating the table or running a complex merge query.

Spreadsheet to relational database

Business data maintained in Excel or Google Sheets often needs to be moved into a MySQL database for web applications or reporting. Converting the spreadsheet to MySQL SQL creates a repeatable, version-controllable import process.

Related CSV tools

Other free converters on CSVShift you might need.

Popular searches
csv to mysql converter import csv to mysql convert csv to mysql how to import csv in mysql csv to mysql insert load csv to mysql csv to mysql table csv to mysql database convert csv to mysql insert query csv to mysql load data infile csv to mysql on duplicate key update import csv into mysql workbench

MySQL SQL generated
in your browser. No upload.

CSVShift generates MySQL INSERT statements and LOAD DATA INFILE syntax entirely in JavaScript in your browser. Your CSV data — which may contain sensitive business records — is never sent to any server. The SQL is built in memory and downloaded or copied directly.

The type inference engine uses MySQL's exact numeric ranges (TINYINT up to 127, SMALLINT up to 32767, MEDIUMINT up to 8,388,607) rather than generic SQL types — producing schemas that store data efficiently without over-allocating column sizes.

MySQL-exact type inference
TINYINT, SMALLINT, MEDIUMINT, INT, BIGINT — using MySQL's actual numeric boundaries, not generic SQL types.
3 import modes
Batch INSERT for portability, single INSERT for debugging, LOAD DATA INFILE for maximum speed on large datasets.
Upsert support
INSERT IGNORE and ON DUPLICATE KEY UPDATE for idempotent imports and incremental data loads without table truncation.
Free, no conditions
No row limit, no file size cap, no watermark. Funded by display advertising only.
Frequently asked questions
Common questions about importing CSV files into MySQL.
How do I import a CSV file into MySQL?
Two main approaches: 1) Convert the CSV to INSERT statements using CSVShift and run the .sql file with mysql -u user -p db < file.sql. 2) Use LOAD DATA INFILE if the CSV is on the MySQL server. For GUI-based imports, use MySQL Workbench's Table Data Import Wizard.
What is LOAD DATA INFILE in MySQL?
LOAD DATA INFILE is MySQL's native bulk import command that reads a CSV file directly from the filesystem. It is 5–20x faster than INSERT statements for large files because it bypasses the SQL parser. It requires the FILE privilege and the CSV must be on the MySQL server. CSVShift generates the full LOAD DATA INFILE syntax with correct FIELDS TERMINATED BY and IGNORE 1 ROWS clauses.
How does ON DUPLICATE KEY UPDATE work in MySQL?
When MySQL encounters a row that would violate a PRIMARY KEY or UNIQUE constraint, instead of raising an error it executes the UPDATE clause. CSVShift generates ON DUPLICATE KEY UPDATE col = VALUES(col) for every column — effectively upserting the row by updating all non-key fields with the incoming values.
How do I convert CSV to MySQL in Python?
Using pandas and SQLAlchemy: df = pd.read_csv('file.csv'); df.to_sql('table', engine, if_exists='append', index=False). Using mysql-connector-python directly: read with csv.DictReader, then execute INSERT with cursor.executemany(). For a no-code browser solution, use CSVShift.
Is my data safe when generating MySQL SQL online?
Yes. The entire SQL generation runs in your browser. Your CSV data is never uploaded or transmitted. Open the Network inspector during conversion — zero outbound requests carrying your data will be made.