[Python] Kernel instantly crashes when executing a simple mysql.connector code

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

  1. Stack

    Stack Membro Participativo

    When I am executing the code below in an .ipynb file it instantly crashes with the following explanation:

    Disposing session as kernel process died ExitCode: 3221225477, Reason:


    My code:

    import mysql.connector as connector

    connection=connector.connect(user="root",password="mysql")


    Output from VSCode:

    [error] Failed to write data to the kernel channel shell [
    <Buffer 3c 49 44 53 7c 4d 53 47 3e>,
    <Buffer 31 37 39 63 65 63 64 33 33 37 66 36 32 39 64 30 30 63 39 65 33 61 35 63 30 31 62 65 32 39 63 37 32 34 35 34 61 30 34 66 61 36 63 63 64 36 35 34 66 31 ... 14 more bytes>,
    <Buffer 7b 22 64 61 74 65 22 3a 22 32 30 32 34 2d 31 32 2d 30 38 54 31 38 3a 33 30 3a 35 38 2e 38 37 37 5a 22 2c 22 6d 73 67 5f 69 64 22 3a 22 38 37 64 65 63 ... 177 more bytes>,
    <Buffer 7b 7d>,
    <Buffer 7b 7d>,
    <Buffer 7b 22 73 69 6c 65 6e 74 22 3a 66 61 6c 73 65 2c 22 73 74 6f 72 65 5f 68 69 73 74 6f 72 79 22 3a 66 61 6c 73 65 2c 22 75 73 65 72 5f 65 78 70 72 65 73 ... 12617 more bytes>
    ] [Error: Socket is closed
    at a.postToSocket (c:\Users\~\.vscode\extensions\ms-toolsai.jupyter-2024.10.0-win32-x64\dist\extension.node.js:304:8060)
    at c:\Users\~\.vscode\extensions\ms-toolsai.jupyter-2024.10.0-win32-x64\dist\extension.node.js:304:7804] {
    errno: 9,
    code: 'EBADF'
    }


    Do you have any idea what could cause this issue? I have been searching for the solution for at least 6 hours, tried reinstalling VSCode, Python, the packages, but nothing seem to helped so far...

    Uninstalling and installing VSCode, MySQL, Python, all packages, pip, jupyter, etc.

    Continue reading...

Compartilhe esta Página