Kodi Community Forum

Full Version: What version of MySQL does the library synch work with?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Currently I've got my library synching with MySQL installed on a WHS machine. But it uses some 120W, so I wanted to see if I can get it to work on a Linksys NSLU2 running the linux based uNSLUng firmware (it uses less than 9W). I managed to create the user, database, and changed the advancedsettings.xml to point to the new location. But when XBMC tries to scan the media folders it stops after a second or so. Checking MySQL reveals that the tables do indeed get created during the initial scan, but it's just not inserting records into them (either during the initial or subsequent XBMC scans), as all the tables are empty.

The uNSLUng repository installs version 4.1.22 of MySQL. I just wonder whether that's the problem, or am I barking up the wrong tree?
Have you checked a debug log to see if there are any clues there?

JR
I think the short answer to my original question is that XBMC synch requires MySQL version 5 and above.

Looking at the XBMC error log, I found a whole heap of SQL errors (I'll post the log if the forum really wants to see it). I'm not a sql expert, but I suspect that I'm running into difference between MySQL 4.1.22 and version 5 and above. E.g. xbmc's script for the table xbmc_video.files probably includes in the create table arguments, the command to create an index on the field strFilename which is supposed to be varchar(512). However MySQL 4.1.22 changes any varchar over 256 to text, and the table would not have been created because you cannot create an index on a text field. Well, you can as long you limit it to (in our example) 512 characters, you just have to specify that in the argument, but the xbmc script wouldn't have anticipated this datatype conversion if you see what I mean, so it's no wonder the table didn't get created.

Speaking of indexes, for some reason the tables that are created by xbmc don't have the appropriate figures set for cardinality. It's supported in 4.1.22 so it could be another issue of syntax between the different versions of MySQL, I've yet to look into it deeply.

So although xbmc does not work with MySQL 4.1.22 out-of-the-box, it might still work if I'm prepared to create/alter tables, indexes and cardinality (and whatever else my untrained eye has missed).

I don't suppose anyone knows of a way of finding the script in xbmc that creates the schemas in xbmc_video & xbmc_music, so that I can see if I can create one specific for my version of MySQL?
In the end I decided to install Debian on the NSLU2, allowing me to install version 5 of MySQL-Server, and it seems to have done the trick. The reason why I've done this was to get around XBMC's need to access the database even when starting up or streaming on-line media (e.g. BBC iPlayer). Quite simply, if XBMC is expecting a connection to a remote database residing on a switched off machine, it just won't start, or the GUI becomes very, very, very unresponsive. So by moving the database onto a low powered device to allow XBMC to operate normally, the NAS can be switched off and only turned on when needed for access to it's storage pool of off-line media.

I did some quick sums, and the 24/7 running costs for the NAS (120W) and NSLU2 (15W) work out at roughly £130 and £15 per annum respectively.
KojakWeb, thank you for your post. At least it showed me I wasn't doing anything wrong...

I installed MySQL 4.1.22 through the ipgk package on my Iomega Ix2-200 NAS server, which also contains all my media. I was hoping to use it as a shared library for my 2 XBMC clients.

After a lot of dropping and creating databases and users I found your post describing exactly my scenario. I really seems that the SQL syntax used by XBMC is not compatible with MySQL version 4.1.22

You said you sorted it out by installing Debian. How could I find out if my NAS would support it? Is it possible I could make it coexist with the original software that came with the NAS?