Converting SQLite to MySQL

Dominik Karall dominik.karall at gmx.net
Sun Nov 12 14:13:58 UTC 2006


hi,

I tried to convert my sqlite database to mysql and followed the 
instructions on:
http://amarok.kde.org/wiki/MySQL_HowTo

following errors occured:
-
ERROR 1071 (42000) at line 23843: Specified key was too long; max key 
length is 999 bytes

line 23843: CREATE TABLE statistics (url VARCHAR(1024),deviceid 
INTEGER,createdate INTEGER,accessdate INTEGER,percentage FLOAT,rating 
INTEGER DEFAULT 0,playcounter INTEGER,uniqueid VARCHAR(32) 
UNIQUE,deleted BOOL DEFAULT 0,PRIMARY KEY(url, deviceid) );
-
there were more such errors, that were caused by UTF-8 which needs 
3byte per character, so 1024 must be changed to something about 300.

another annoying bug:
mysql seems to be case insensitive on inserts, so all my songs which 
are unique on my hdd (e.g. FOD.mp3 and fod.mp3) are treated as 
duplicate in mysql.

Conclusion:
IMHO there is no easy way to convert sqlite dbs to mysql. maybe these 
errors should be mentioned on the wiki too.
but I'm asking myself, if these create table statements and inserts 
don't work with mysql correctly, how do they work native in amarok? 
because the case insensitivity could cause some problems with 
uniqueness.

cheers,
dominik



More information about the Amarok mailing list