That is strange. I would install pymysql in a virtual environment and then drop some debugging lines in this function:
https://github.com/PyMySQL/PyMySQL/blob/master/pymysql/connections.py#L940
That should show what variables its actually using for the connection and make it obvious what is wrong.