Fixed MySQL initializing logic