Problem transforming Python SQL program into EXE

40 Views Asked by At

I'm facing a problem when trying to connect to a cloud bank with Planet Scale, MySQL and Python. While I'm in Visual Studio Code everything works perfectly, but when I use PyInstaller and run the code, I get the following problem:

Requested Module was not found: No module named 'mysql.connector.plugins.mysql_native_password'
Traceback (most recent call last):
File "BancoDeDadosOnline.py", line 155, in <module>
License_Update()
File "BancoDeDadosOnline.py", line 10, in License_Update
connection = mysql.connector.connect(
File "mysql\connector\pooling.py", line 294, in connect
File "mysql\connector\connection.py", line 169, in __init__
File "mysql\connector\abstracts.py", line 1237, in connect
File "mysql\connector\connection.py", line 355, in _open_connection
File "mysql\connector\connection.py", line 288, in _do_auth
File "mysql\connector\authentication.py", line 355, in authenticate
File "mysql\connector\protocol.py", line 362, in make_auth
File "mysql\connector\protocol.py", line 252, in auth_plugin_first_response
File "mysql\connector\plugins\__init__.py", line 162, in get_auth_plugin
mysql.connector.errors.NotSupportedError: Authentication plugin 'mysql_native_password' is not supported
[10536] Failed to execute script 'BancoDeDadosOnline' due to unhandled exception!

I've tried several ways, including uninstalling mysql-connector-python and installing it again. I also tried ALTER USER, but it didn't work because the user and connection were from Planet Scale.

def License_Update():

# Estabeleça a conexão com o banco de dados
 connection = mysql.connector.connect(
 host='aws.connect.psdb.cloud',
 user='myuser',
 password='mypassword',
 database='licenses_teste',
 ssl_verify_identity=True,
 ssl_ca='cacert-2023-08-22.pem',
 use_pure=True
 )

I've tried several ways, including uninstalling mysql-connector-python and installing it again. I also tried ALTER USER, but it didn't work because the user and connection were from Planet Scale.

0

There are 0 best solutions below