I tried to run the same code locally and works fine for me.
Screenshot of the successful run
Please try to execute the script directly from powershell using the following command:
python mysql.py
To ensure that the problem is not the IDLE shell.