add mysql script to res, add DAO, add hash packet and classes, finish registration impl and some minor changes