Is it possible to convert SQLite to MySQL “as is”?
Probably the quick and easiest way to convert SQLite to MySQL includes two general steps:
- Export SQLite database to dump file using SQLite .dump command.
|
|
- You can then (in theory) import SQLite dump into the MySQL database.
|
|
“In theory” means that solution wouldn’t work as there are a few differences in grammars between MySQL and SQLite.
There are just some differences between SQLite and MySQL syntax
SQLite | MySQL |
---|---|
AUTOINCREMENT | AUTO_INCREMENT |
TEXT | varchars |
double quotes (" “) | backticks (` `) |
BEGIN TRANSACTION; COMMIT; |
BEGIN; COMMIT |
CLOB | TINYTEXT, TEXT, MEDIUMTEXT, LONGTEXT |
PRAGMA foreign_keys=OFF; | SET FOREIGN_KEY_CHECKS=0; |