lol you definately DON'T want to use 5017 src as a base to do your mysql i can tell ya that or you will just end up with the same unstable issues lotf has allready. It was one of the biggest flaws in lotf in the first place in that the sql code is all done very poorly and improperly.
Using it as a reference to convert 5165 to mysql will only result in making the source even more unstable then it allready is.
Your best bet is to find a difference source that actually has a stable database system and LOTF isn't 1 of them.