struct finished while output to file
prepare mysql