You could also create a small plugin that adds a docker container to tutor’s docker-compose. In that container, you can install pymsql, provide MySQL service address and then run your scripts.
We made a plugin that does something along the same lines. It starts a container with a Django app that stores some data in the MySQL database. You might find some inspiration from there: