How to convert a TSV file to MySQL
A TSV file is a CSV with tabs instead of commas — common from spreadsheet exports, mysqldump --tab, and data pipelines. SQLified detects the tab delimiter automatically and writes a clean CREATE TABLE + INSERT script you can run in any MySQL client, with no file access required.
- Drop your TSV onto the converter above (.tsv, .tab, or tab-delimited .txt).
- Review the schema. SQLified infers MySQL types and adds an auto-increment key. Adjust types, nullability, rename columns, or set your own primary key.
- Generate the SQL — a
CREATE TABLEplus batchedINSERTstatements. - Run it in MySQL Workbench, the
mysqlCLI, or phpMyAdmin.
What the generated SQL looks like
CREATE TABLE IF NOT EXISTS `events` (
`id` INT NOT NULL AUTO_INCREMENT,
`event` TEXT NOT NULL,
`occurred_at` DATETIME NOT NULL,
`value` DECIMAL(18,2) NOT NULL,
PRIMARY KEY (`id`)
);
INSERT INTO `events` (`event`, `occurred_at`, `value`) VALUES
('login', '2026-01-04 08:12:00', '0.00'),
('purchase', '2026-01-04 08:15:30', '49.99');Identifiers are backtick-quoted, and when your data has no key, SQLified adds an AUTO_INCREMENT id so every row is uniquely identified.
MySQL type inference
- Whole numbers →
INT/BIGINT(by range). - Decimals →
DECIMAL(18, n). - Dates and timestamps →
DATE/DATETIME. true/false→TINYINT(1).- Everything else →
TEXT.
Large files and max_allowed_packet
MySQL refuses any statement bigger than max_allowed_packet (commonly 4–64 MB). A single giant INSERT for a big tab-delimited export hits that wall. SQLified batches the output into 1,000-row statements, so each stays well under the limit and even multi-million-row files import without tuning.
Frequently asked questions
What is a TSV file?
A TSV (tab-separated values) file separates columns with a Tab character instead of a comma. SQLified detects the delimiter automatically, so .tsv, .tab, and tab-delimited .txt files all work.
How does this compare to LOAD DATA INFILE with a tab delimiter?
LOAD DATA INFILE ... FIELDS TERMINATED BY '\t' is fast but needs file access on the server and the right privileges. SQLified's INSERT statements are portable — paste them into MySQL Workbench, the mysql CLI, or phpMyAdmin, which is ideal for managed MySQL like PlanetScale or RDS.
Will big tab-delimited files import cleanly?
Yes. MySQL rejects statements larger than max_allowed_packet (often 4–64 MB). SQLified batches the output into 1,000-row INSERTs so each statement stays small and a multi-million-row file imports without tuning.
Does it add a primary key?
If your data has no key, SQLified adds an AUTO_INCREMENT id column. Mark one of your own columns as the key and it uses that instead.
Is my file uploaded?
No — the conversion runs entirely in your browser. Your tab-delimited file is never sent to a server or stored.