You can drag a spreadsheet or CSV file straight into a database tool and have it write the table for you, but the results are only as good as the preview and column mapping you check on the way through. A table data import wizard is the built-in dialog (in MySQL Workbench, for example, it is called Table Data Import Wizard) that reads a file, guesses the column types, lets you rename fields and pick a destination table, then inserts the rows and reports how many succeeded and how many failed. The short version: open the wizard from the schema tree, choose the file, pick Create new table or Use existing table, confirm the columns and types, then run it and read the log at the end. Before you start, clean the file so the first row is a header and every row has the same number of fields, and make sure you have a database user with permission to create or write to tables.
What You'll Need
- A database tool that includes an import wizard (MySQL Workbench and comparable clients all ship one) and a connection to a running server.
- A data file in a supported format. CSV is the most reliable; most wizards also handle tab-delimited text and some read XLSX.
- Permission to create tables or insert rows in the target schema. If in doubt, ask whoever administers the database.
- A clean header row with unique, short column names and no merged cells, blank rows at the top or title rows.
- The character encoding your file was saved in (usually UTF-8), so accented characters and symbols do not turn into question marks.
Step-by-Step
- Wash the file first. Open the spreadsheet, delete blank rows above the header, remove merged cells, and make sure each column heading is unique (not two columns both called "Date"). Save as CSV with UTF-8 encoding. Spot any cells that mix text and numbers in one column — those are the ones that break imports.
- Connect to your server in the database tool and expand the schema (database) you want to import into in the sidebar tree so the object list is visible. Menu labels differ slightly between tool versions, platforms and themes, so treat the names below as the general shape of the flow.
- Right-click the schema name and choose the table data import option from the context menu. In MySQL Workbench this is Table Data Import Wizard. A dialog opens and asks for the source file path.
- Browse to your CSV and confirm the format detection. The wizard usually shows a preview of the first rows. If fields run together in one column, the delimiter is wrong — switch it to comma, semicolon or tab to match your file.
- Choose the destination. Pick Create new table for a clean first load, or Use existing table if the table is already there with the right structure. For a first attempt, creating a new table is safer because nothing existing is touched.
- Review the column mapping. The wizard lists each field with a suggested type — integers, decimals, dates, text. Check the important ones yourself: a postcode or phone number should be text, not a number, or it will lose leading zeros; a date column should be a date type, not text; long free-text fields should be generous text types. Adjust names and types here rather than fixing them afterwards.
- Confirm encodings and the default charset/collation for the new table. UTF-8 (utf8mb4 in MySQL) is the sensible default for mixed-language data.
- Click Next and let the wizard run. It shows progress per row batch and finishes with a summary: the number of rows imported, the number of rows skipped, and any messages. Click Finish and refresh the schema tree so the new table appears.
- Verify the result. Run a quick
SELECT * FROM schema.table LIMIT 20;to eyeball the first rows, then check a row count against the file and look at a date and a decimal column — those are the first to go wrong. Compare totals before you declare success. - If you are importing a large file, do it in batches by splitting the CSV rather than running one huge job. A failed run that gives no clear error is often a timeout rather than bad data.
Common Mistakes
The most frequent failure is a file with no header row, so the first data record becomes the column names and everything shifts by one. Second is a mismatched delimiter: European exports often use semicolons, and the wizard's default comma silently crams whole rows into one column. Third is type guessing going wrong — a column of IDs read as an integer when some IDs are alphanumeric, which truncates or rejects those rows. Fourth is importing into a table whose existing columns do not match the file order, so values land in the wrong fields. Fifth is ignoring the trailing blank line or stray commas at the end of the file, which can create an extra empty column. Finally, people often skip the summary screen and assume every row went in; the skipped-row count is the number that matters.
Tips
Import into a scratch schema first, inspect the result, then copy the table where you actually want it. Keep the CSV file itself as your source of truth for the first run so you can re-import rather than patch rows by hand. Name columns in lower case with underscores so you do not need to quote identifiers later. If a column must be unique, note that the wizard will not add a primary key for you on an existing table — add it afterwards once you have checked for duplicates. For repeated imports, the wizard's settings are predictable enough that you can script the same load with the client's command-line import tool after the first successful run. Test one import with a small slice of the data (say the first few hundred rows) before committing the whole file.
Troubleshooting
Nothing imports and the log is empty. Check you selected the right file and that column mapping reached the final screen. Cancel out, reopen the wizard and step through slowly.
Garbled characters. The file and the table encodings disagree. Re-save the CSV as UTF-8, empty the table, and import again. Do not try to fix mojibake row by row.
Dates rejected or shifted by a day. Mixed date formats in one column are the usual cause. Standardise the column to one format (ISO-style yyyy-mm-dd is the least ambiguous) before importing.
Leading zeros lost or numbers rounded. The column was mapped as numeric. Change it to a text type in the mapping step and re-run.
Duplicate key errors. The target table has a unique constraint and the file contains repeated values. Either clean the file or import into a fresh table and deduplicate afterwards.
Connection dropped or timeout on big files. Split the file, or use the command-line import tool that streams rather than loading through the GUI. If the wizard offers a batch-size setting, lower it.
If none of that helps, import a single row as a test. If one row works, the wizard and connection are fine and the fault is in the file; if one row fails, the destination table or permissions are the problem.
Frequently Asked Questions
Does the import wizard change my existing table?
If you choose Use existing table it adds rows to it. If you choose Create new table it writes a brand-new table and leaves existing ones alone. Neither option deletes data, but rows in the existing table can be duplicated by a second import.
Will the wizard create a primary key or indexes for me?
Types and column names are set during mapping, but do not rely on the wizard for keys or indexes. Add them after you have verified the data.
Can I import into a remote database?
Yes, the import runs through your normal connection, so the same credentials and firewall access you use to browse the schema apply.
What happens to rows that fail?
Behaviour depends on the client: many continue past bad rows and report skipped counts, others abort the whole import. Read the summary screen before you close it, and always verify row counts in the table afterwards.
Is there a row limit?
Limits vary by tool and are usually practical rather than fixed — connection timeouts count for more than row counts. Split your file or use the command-line tool for very large loads.
Do I need to re-format Excel files first?
Save to CSV rather than importing the workbook directly. It removes formatting, merged cells and multiple sheets as sources of error.