[Python] The python interpreter shows the message like it's about to execute, and it does not...

Discussão em 'Python' iniciado por Stack, Fevereiro 15, 2025.

  1. Stack

    Stack Membro Participativo

    I wrote this code for testing purposes:

    import mysql.connector

    cnx = mysql.connector.connect(
    host="localhost",
    user="root",
    password="abc@123",
    database="devfit",
    port='3306'
    )

    print(cnx)

    cursor = cnx.cursor()

    cursor.execute("SELECT * FROM aluno")
    result = cursor.fetchall()

    for line in result:
    print(line)


    And when I execute the app, this happens:

    console

    The code does not even run. The Python interpreter shows the message like it's about to execute, and it does not return any error, nothing, it just shows the empty CLI line after the execution without event running the app. Can somebody help me?

    I tried to reinstall Python and MySQL Workbench and MySQL server. Despite the efforts to get app to run, it does not run. I installed mysql-connector-python, and this happens. It doesn't happens when I use mysql-connector, but this version does not support auth, and the SQL configurator does not allows to config the root user without a password.

    Continue reading...

Compartilhe esta Página