Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.w22.dev/llms.txt

Use this file to discover all available pages before exploring further.

MySQL UI’s import feature lets you load a .sql file directly into your database. You can use it to restore a backup, migrate data from another server, or seed a fresh database — all without leaving the browser.

Opening the import dialog

In the sidebar toolbar, click the Upload (↑) icon. The import dialog opens over your current database view.

Import options

SQL file

Click the dashed file drop zone to open your system’s file picker and select a .sql (or .txt) file. Once selected, the filename and file size are shown so you can confirm you’ve chosen the right file.

Target database (optional)

Enter a database name in the Target database field if you want MySQL UI to create a new database and import into it automatically. MySQL UI will run CREATE DATABASE IF NOT EXISTS followed by USE before executing any statements in your file. Leave this field blank to import into the database that is currently selected in the sidebar.

What MySQL UI does with your SQL

After you click Import, MySQL UI processes your file in the following order:
  1. Strips any byte-order mark (BOM) that some editors add to the beginning of files
  2. Strips SQL comments (-- and /* ... */ style)
  3. Splits the remaining content into individual statements
  4. Executes each statement against your database one at a time
When the import finishes, a result summary appears in the dialog showing:
  • Total statements found in the file
  • Executed — how many statements ran successfully
  • Errors — any failures, listed by statement number with the error message

Handling errors

If one or more statements fail, the import does not stop or roll back. MySQL UI continues executing the remaining statements and reports all failures together at the end. This means a partial import is possible — for example, if some tables already exist and others do not. Review the error list after import and re-run or adjust any failed statements as needed.
The easiest way to create a compatible dump file is to use MySQL UI’s own export feature. It generates clean SQL that imports without errors, including DROP TABLE IF EXISTS guards and properly escaped values.
If your SQL file contains DROP TABLE IF EXISTS statements, importing it will permanently delete any existing tables with those names before recreating them. Always review your SQL carefully before importing into a production database.