XlsConverter

CSV to MySQL with a ready CREATE TABLE and INSERT script

Upload the CSV, confirm the delimiter and header row, name the table, then convert. You get a .sql file for MySQL that you can run with the mysql client or paste into any admin tool.

CSV

Encrypted, auto-deleted

Demo converts up to 100 rows, once.
Database administrator with a laptop in a server room aisle

LOAD DATA LOCAL INFILE is the fastest way to bring a CSV into MySQL, but it is switched off on many managed servers and shared hosts, and it fails quietly on encoding or line ending mismatches. A plain SQL script avoids all of that: it runs through any connection that can execute queries.

This page has MySQL selected as the dialect, with backtick quoting and utf8mb4 text. If the data starts in a workbook, use Excel to MySQL, and for the same CSV aimed at Postgres see CSV to PostgreSQL.

How to convert CSV to MySQL in three steps

  1. 1Upload the .csv file.
  2. 2Check the delimiter and header row, then set the table name.
  3. 3Convert and run the downloaded .sql script against your MySQL database.

MySQL specific pitfalls when importing CSV data

The utf8 character set in MySQL is really a three byte subset of Unicode, so emoji and some rare characters fail with an incorrect string value error. The script declares utf8mb4 for the table and the session, which stores the full range. If you load into an existing table, make sure its columns use utf8mb4 too, otherwise the server still rejects those rows.

Escaping is the second classic problem. MySQL treats the backslash as an escape character inside strings by default, so a Windows path like C:\temp\new or a name with an apostrophe breaks a script written by hand. Every value is escaped for MySQL rules, and column names are wrapped in backticks, so a header like order or group does not collide with reserved words.

Dates in CSV files come in every shape. MySQL only accepts DATE and DATETIME values in year-month-day order, and in strict mode a value like 03/04/2026 is an error. Set the date format to ISO so the script writes 2026-03-04. Large files are split into multi row INSERT batches that stay under the default max_allowed_packet. For a generic overview of dialects see CSV to SQL.

CSV to MySQL questions

How do I import a CSV file into MySQL without LOAD DATA?

Convert the CSV into a SQL script here and run it with the mysql client or an admin tool. It works on servers where local file imports are disabled.

Does the script create the MySQL table for me?

Yes, with CREATE TABLE enabled it defines the table with inferred types. Turn it off to insert into a table you already have.

Why do emoji fail when I import CSV into MySQL?

The legacy utf8 charset cannot store four byte characters. The script uses utf8mb4, and your target columns should use it too.

How are dates written for MySQL?

Choose the ISO date format and dates are written as year-month-day, the form MySQL accepts in strict mode.

Can I try CSV to MySQL conversion first?

Yes, with the one-time demo of up to 100 rows. Full files need a paid plan, from 24 USD per month billed yearly.

Related converters

Convert full files and batches

Pro starts at $24 per month billed yearly. Cancel any time.

See plans