Implemented MySQL code in auth and logs.