How to convert json to mysql insert statements
- Step 1Prepare the JSON array — Each array element maps to one database row. All objects should have the same keys. Remove computed fields or internal-only properties that do not correspond to database columns.
- Step 2Enter the table name — Type the MySQL table name in the options panel. The converter wraps the name in backticks to handle any reserved word conflicts.
- Step 3Set the batch size for multi-row INSERT — Large datasets benefit from batching. Set the rows-per-INSERT to 500–1000 to avoid packet-size errors with MySQL's max_allowed_packet setting. The converter splits the output into multiple INSERT statements at the specified batch size.
- Step 4Run via mysql CLI or migration tool — Save the output as seed.sql and run mysql -u root -p mydb < seed.sql, or paste the statements into a Flyway V1__seed_data.sql migration file.
Frequently asked questions
How do I handle MySQL's DATETIME vs TIMESTAMP column types?+
ISO-8601 date strings in the JSON are emitted as SQL string literals in single quotes — '2024-01-15 10:30:00'. MySQL accepts this format for both DATETIME and TIMESTAMP columns. If your dates include a T separator (e.g. 2024-01-15T10:30:00Z), the converter normalizes them to MySQL's expected YYYY-MM-DD HH:MM:SS format.
What happens to JSON objects nested inside record fields?+
Nested JSON objects and arrays are serialized as JSON strings wrapped in single quotes, suitable for MySQL's json column type. If the column is not a json type, flatten the nested structure using the JSON Flattener tool before generating the SQL.
Is the migration data transmitted to JAD Apps?+
No. SQL generation runs entirely in your browser. Migration records, test fixture data, and any sensitive values in the JSON are never transmitted to JAD Apps servers.
Privacy first
Conversion runs locally in your browser. No file is uploaded — only metadata counters are saved for signed-in dashboard stats.