MySQL to SQLite Converter Online

Convert MySQL queries & phpMyAdmin .SQL dumps into 100% error-free SQLite3 format with automatic Primary Key & AUTOINCREMENT fixing!


Removes transaction/PRAGMA conflicts
Moves bottom ALTER PRIMARY KEY inline
Creates valid CREATE INDEX statements
0 Lines
100% Client-Side Processing. Your database queries never leave your browser!
Waiting for input...
Ready to run in PHP PDO, SQLite3 CLI, or DB Browser for SQLite.
⚑ 100% Free & Instant πŸ› οΈ Fixes phpMyAdmin Dumps πŸ”’ 100% Client-Side Privacy πŸ’» DB Browser & PHP PDO Ready

The Ultimate Free MySQL to SQLite Query & Dump Converter

Migrating a web application from a server-based database like MySQL or MariaDB to a serverless, self-contained database like SQLite3 is essential when building standalone desktop software (such as PHP Desktop `.exe` apps), mobile applications, or lightweight web tools. However, directly importing a standard MySQL `.sql` dump into SQLite results in immediate syntax errors. The Techno Smarter MySQL to SQLite Converter automatically rewrites incompatible MySQL syntax into clean, standard SQLite3 commands in milliseconds.

How to Convert MySQL to SQLite Online (Step-by-Step Guide):

Our intelligent parser handles both single `CREATE TABLE` queries and full multi-table phpMyAdmin database exports:

  • Step 1: Upload or Paste Your MySQL Code: Export your database from phpMyAdmin as a standard `.sql` file and select it using the file uploader above, or directly paste your MySQL query into the left editor box.
  • Step 2: Configure Safe Mode Options: Keep "DB Browser Safe Mode" and "Auto-Fix phpMyAdmin Keys" enabled. This ensures that bottom-of-file `ALTER TABLE` primary keys are merged directly into the table creation script.
  • Step 3: Convert Live: Click "Convert MySQL to SQLite Live". Our engine instantly strips `ENGINE=InnoDB`, converts data types (`INT`, `VARCHAR`, `DECIMAL`), and formats string escapes.
  • Step 4: Copy or Download for SQLite: Click "Copy SQLite Code" and paste it directly into the Execute SQL tab of DB Browser for SQLite, or download the `.sql` file to import into your PHP PDO `database.sqlite` project.

Why Standard MySQL Dumps Fail in SQLite (And How We Fix Them)

When phpMyAdmin exports a MySQL database, it separates table structures from primary keys and auto-increment rules, placing `ALTER TABLE ... MODIFY` statements at the very bottom of the file. Because SQLite does not support `MODIFY` or adding a `PRIMARY KEY` after a table is created, standard dumps fail. Our tool scans your entire SQL script first, detects all primary keys and auto-increment columns at the bottom, and seamlessly injects `INTEGER PRIMARY KEY AUTOINCREMENT` directly inside the `CREATE TABLE` block.

πŸ”‘ Smart Key & Index Merger

Automatically intercepts phpMyAdmin `ALTER TABLE ADD PRIMARY KEY` and `MODIFY AUTO_INCREMENT` commands and merges them inline into your SQLite table definitions.

πŸ›‘οΈ DB Browser Safe Mode

Eliminates the frustrating "cannot start a transaction within a transaction" and "Execution aborted by user" errors in DB Browser for SQLite by cleaning conflicting PRAGMA locks.

πŸ”’ 100% Local Browser Privacy

Your database dumps often contain sensitive user emails, hashed passwords, and business records. Everything runs via local JavaScriptβ€”zero data ever touches our server.

MySQL vs. SQLite Syntax Differences Handled by Our Tool

  • Auto-Increment Primary Keys: Converts MySQL `INT(11) NOT NULL AUTO_INCREMENT` into SQLite's strict `INTEGER PRIMARY KEY AUTOINCREMENT`.
  • Data Type Mapping: Converts `TINYINT`, `SMALLINT`, `BIGINT` to `INTEGER`; `VARCHAR(n)`, `ENUM`, `LONGTEXT` to `TEXT`; and `DECIMAL(n,n)`, `DOUBLE`, `FLOAT` to `REAL`.
  • Timestamps & Updates: Replaces `current_timestamp()` with `CURRENT_TIMESTAMP` and strips unsupported `ON UPDATE current_timestamp()` clauses.
  • String Escaping: Converts MySQL backslash-escaped quotes (`\"` and `\'`) inside `INSERT INTO` values into standard SQLite double-single quotes (`''`).

Frequently Asked Questions (FAQs)

Q: How do I connect my converted SQLite database in PHP PDO?

Once you run the converted SQL in DB Browser for SQLite and save your file as database.sqlite, simply replace your MySQL PDO connection string with: $db = new PDO("sqlite:database.sqlite");. All your standard PDO prepared statements will work offline without XAMPP!

Q: Why was I getting "cannot start a transaction within a transaction" in DB Browser?

GUI tools like DB Browser for SQLite automatically wrap your execution tab inside an active transaction. If your SQL script also contains BEGIN TRANSACTION; or START TRANSACTION;, SQLite throws a conflict error. Our "DB Browser Safe Mode" removes these redundant lines automatically.

Q: Does this converter support large phpMyAdmin .sql files with INSERT data?

Yes! You can upload complete `.sql` files containing both `CREATE TABLE` structures and thousands of `INSERT INTO` rows. Our parser preserves all your inserted records while fixing escaped quotes for SQLite compatibility.

Q: What happens to MySQL UNIQUE keys and indexes during conversion?

When "Convert Indexes to SQLite" is checked, our tool converts MySQL's `ADD UNIQUE KEY` and `ADD KEY` statements into standalone `CREATE UNIQUE INDEX IF NOT EXISTS` and `CREATE INDEX IF NOT EXISTS` statements supported by SQLite3.