Connecting Tech Pros Worldwide Forums | Help | Site Map

SQLITE -> MySQL syntax differences complete list

dlite922's Avatar
Expert
 
Join Date: Dec 2007
Location: Moon, Dark Side
Posts: 1,095
#1: Jul 6 '09
I'm trying to convert an SQLITE database to MySQL syntax and it seems every resource I find on google is only half complete.

I want to create this thread to sum them all up in one central location; Finally a bulleted list of all the rules you have to apply to your script to completely and fully transfer /any/ sqlite schema dump to a MySQL one.

For this I need your help; I'll start with the popular few, anyone notice any other difference, please post it in a reply. Please keep the same bulleted numbering. If you correct a mistake, note the bullet number (e.g. number 3 is wrong, should be...)


1. Replace BEGIN TRANSACTION with BEGIN;
2. Replace all double quotes " with back-ticks `
3. Remove any line that begins with "sqlite..."
4. Replace AUTOINCREMENT with AUTO_INCREMENT
5. ???


Thanks in advance for helping this resource; I'm sure many will find it useful.



Dan

dlite922's Avatar
Expert
 
Join Date: Dec 2007
Location: Moon, Dark Side
Posts: 1,095
#2: Jul 6 '09

re: SQLITE -> MySQL syntax differences complete list


5. Replace "shortint" with "tinyint"


Optional: Add DROP TABLE IF EXISTS or IF NOT EXISTS to table commands, based on your specific needs of course.

Optional: Ignore the "metadata" table that sqlite dump creates.



Dan
Reply

Tags
convert, difference, migration, mysql, sqlite