[Python] Mysql connector for python appears to be crashing, how can I diagnose the problem?

Discussão em 'Python' iniciado por Stack, Dezembro 9, 2024.

  1. Stack

    Stack Membro Participativo

    The following code is expected to print, "A", "B", and "C":

    print ("A")
    import mysql.connector
    print("B")
    mydb = mysql.connector.connect(
    host="localhost",
    user="test",
    password="testpass",
    )
    print("C")


    For some reason it prints "A", and "B", but never C. If I change the port to an incorrect port, it gives an error, so it seems to be connecting. I have tried adding a long time-out and that does not help. I have also tried connecting through the mysql command-line, and I am able to connect. I have also tried adding a try{} except{} block; the code never reaches the except block.

    What can I do to determine the problem?

    Continue reading...

Compartilhe esta Página