I ran into a similar problem with the python Redis library. I follow the same documentation instructions that you mentioned in your second link.
Here is an example snippet for your reference:
Create a new directory MyPythonLambda and put MyPythonLambda.py in the same.
Suppose MyPythonLambda / MyPythonLambda.py is the main handler containing lambda.
cd MyPythonLambda/ pip install redis -t . zip -r MyPythonLambda.zip *
Download / import zip in creating lambda from S3 or local file system.
I think you need to create a zip file in a similar way containing your python mysql library.
source share