|Having used neither raspberry pi and/or mysql EVER, I might be chasing down a pot-o-fool's gold here (Raspberry Pi? That's expired pharmacy my friend) but I see THAT connString and always say to myself "config issue/networking port" issue.
I might open up Task Manager and set the display to anything that resembles the realtime CPU use, probably where there's a network monitoring graph that one can set the sample speed FASTER, then go through the motions which cause this "freeze" ... and see if the two things align in time.
Come to think of it, VS (C#? Unlikely slow (blazes fast eh?)) ... leaves frozen footprints sometimes when running debug. Now, there's an idea!
Run debug while under VS gravitational pull.