I experienced very similar issue when using Python v3.12 (64 bit) with mysql-connector-python 9.2.0 and 9.1.0
It turns out that mysql-connector-python 9.2.0 and 9.1.0 started working when I used Python v3.12 (32 bit)
Since I need to use python 64 bit, I had to downgrade mysql-connector-python to 9.0.0
However, keep in mind that there is a known vulnerability with version 9.0.0 (details: https://github.com/advisories/GHSA-hgjp-83m4-h4fj )