Forums

Can't Access MySQL database from Workbench 8 on Windows

I just upgraded to a paid account, for my site which has a simple database, with around 6 columns. I have not had any luck connecting to it from MySQL Workbench (current version). I have followed the instructions on https://help.pythonanywhere.com/pages/AccessingMySQLFromOutsidePythonAnywhere/, spent hours getting Workbench installed, and a few hundred dollars on Codementor, along with installing putty. As this site gets a lot of Noob's like me, it would be great if they added a simple tutorial of how to install a CS50 like project on here, along with a simple db management tool like PhpLiteAdmin to make it easy to manage and delete db posts without having to resort to the command line, which is impractical for a large number of entries.

Current error is 'Could not detect SSH Tunnel.' Access denied for 'none'. Authentical that can continue: publickey, password. Log as follows:

17:38:33 [INF][      Workbench]: Current environment:
    Command line: "C:\Program Files\MySQL\MySQL Workbench 8.0 CE\MySQLWorkbench.exe" 
    CurrentDirectory: C:\Program Files\MySQL\MySQL Workbench 8.0 CE
    HasShutdownStarted: False
    OSVersion: Microsoft Windows NT 6.2.9200.0
    SystemDirectory: C:\WINDOWS\system32
    TickCount: 518935656
    UserInteractive: True
    Version: 4.0.30319.42000
    WorkingSet: 42143744
17:38:33 [INF][      Workbench]: Environment variables:
    SystemDrive = C:
    ProgramFiles(x86) = C:\Program Files (x86)
    ProgramW6432 = C:\Program Files
    PROCESSOR_IDENTIFIER = Intel64 Family 6 Model 58 Stepping 9, GenuineIntel
    TMP = C:\Users\Michael\AppData\Local\Temp
    PROCESSOR_ARCHITECTURE = AMD64
    Path = C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.1\bin;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.1\libnvvp;;C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Git\cmd;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\PuTTY\;C:\Program Files\MySQL\MySQL Utilities 1.6\;C:\Users\Michael\AppData\Local\Microsoft\WindowsApps;C:\Program Files\Microsoft VS Code\bin;C:\Users\Michael\AppData\Local\atom\bin;C:\Users\Michael\Anaconda3\Scripts;;%USERPROFILE%\AppData\Local\Microsoft\WindowsApps
    PROCESSOR_REVISION = 3a09
    TEMP = C:\Users\Michael\AppData\Local\Temp
    USERPROFILE = C:\Users\Michael
    CommonProgramFiles(x86) = C:\Program Files (x86)\Common Files
    LOGONSERVER = \\MICHAELLESAGE
    USERNAME = Michael
    SystemRoot = C:\WINDOWS
    OneDrive = C:\Users\Michael\OneDrive
    NVCUDASAMPLES_ROOT = C:\ProgramData\NVIDIA Corporation\CUDA Samples\v9.1
    NVTOOLSEXT_PATH = C:\Program Files\NVIDIA Corporation\NvToolsExt\
    CommonProgramFiles = C:\Program Files\Common Files
    ProgramData = C:\ProgramData
    HOMEPATH = \Users\Michael
    COMPUTERNAME = MICHAELLESAGE
    ALLUSERSPROFILE = C:\ProgramData
    CommonProgramW6432 = C:\Program Files\Common Files
    MOZ_PLUGIN_PATH = C:\Program Files (x86)\Nuance\Power PDF\Bin\;C:\Program Files (x86)\Foxit Software\Foxit Reader\plugins\
    SESSIONNAME = Console
    CUDA_PATH = C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.1
    DriverData = C:\Windows\System32\Drivers\DriverData
    CUDA_PATH_V9_1 = C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.1
    NVCUDASAMPLES9_1_ROOT = C:\ProgramData\NVIDIA Corporation\CUDA Samples\v9.1
    windir = C:\WINDOWS
    NUMBER_OF_PROCESSORS = 8
    OS = Windows_NT
    ProgramFiles = C:\Program Files
    ComSpec = C:\WINDOWS\system32\cmd.exe
    HOMEDRIVE = C:
    PATHEXT = .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
    PSModulePath = C:\Program Files\WindowsPowerShell\Modules;C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules
    APPDATA = C:\Users\Michael\AppData\Roaming
    USERDOMAIN = MICHAELLESAGE
    PROCESSOR_LEVEL = 6
    LOCALAPPDATA = C:\Users\Michael\AppData\Local
    USERDOMAIN_ROAMINGPROFILE = MICHAELLESAGE
    PUBLIC = C:\Users\Public
    17:38:33 [INF][      Workbench]: Current version given by meta info is: 8.0.15
    17:38:33 [INF][      Workbench]: Setting PATH to: C:\WINDOWS\system32;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.1\bin;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.1\libnvvp;;C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Git\cmd;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\PuTTY\;C:\Program Files\MySQL\MySQL Utilities 1.6\;C:\Users\Michael\AppData\Local\Microsoft\WindowsApps;C:\Program Files\Microsoft VS Code\bin;C:\Users\Michael\AppData\Local\atom\bin;C:\Users\Michael\Anaconda3\Scripts;;%USERPROFILE%\AppData\Local\Microsoft\WindowsApps
    17:38:33 [INF][ mforms managed]: Initializing mforms wrapper
    17:38:33 [INF][   WBContext UI]: Initializing workbench context UI with these values:
        base dir: C:\Program Files\MySQL\MySQL Workbench 8.0 CE
        plugin path: C:\Program Files\MySQL\MySQL Workbench 8.0 CE
        struct path: 
        module path: C:\Program Files\MySQL\MySQL Workbench 8.0 CE/modules
        library path: C:\Program Files\MySQL\MySQL Workbench 8.0 CE
        user data dir: C:\Users\Michael\AppData\Roaming\MySQL\Workbench
        open at start: 
        open type: 
        run at startup: 
        run type: 
        Force SW rendering: No
        Force OpenGL: No
        quit when done: No
    17:38:33 [INF][      WBContext]: WbContext::init
    17:38:33 [INF][            WBA]: Looking for extension modules for WBA...
    17:38:33 [INF][            WBA]: 0 extension modules found
    17:38:34 [WRN][            grt]: C:\Program Files\MySQL\MySQL Workbench 8.0 CE\modules/data/mysql_rdbms_info.xml:1446: link 'om.mysql.rdbms.mysql.driver.native_sshtun' <object > key=owner could not be resolved
    17:38:34 [WRN][            grt]: C:\Users\Michael\AppData\Roaming\MySQL\Workbench\connections.xml:28: link '{86629261-B777-4194-8F36-9E28EA06B9B5}' <object GrtObject> key=owner could not be resolved
    17:38:34 [INF][      WBContext]: System info:
        MySQL Workbench Community (GPL) for Windows version 8.0.15 CE build 14271522 (64 bit)
        Configuration Directory: C:\Users\Michael\AppData\Roaming\MySQL\Workbench
        Data Directory: C:\Program Files\MySQL\MySQL Workbench 8.0 CE
        Cairo Version: 1.10.2
        OS: Microsoft Windows 10 Home
        CPU: 8x Intel(R) Core(TM) i7-3630QM CPU @ 2.40GHz, 7.9 GiB RAM
        Active video adapter Intel(R) HD Graphics 4000
        Installed video RAM: -1984 MB
        Current video mode: 1600 x 900 x 4294967296 colors
        Used bit depth: 32
        Driver version: 10.18.10.4358
        Installed display drivers: igdumdim64.dll,igd10iumd64.dll,igd10iumd64.dll
        Current user language: English (Canada)

    17:38:34 [INF][      Workbench]: UI is up
    17:38:34 [INF][      Workbench]: Running the application
    17:38:41 [INF][SSHTunnelManager]: Wakeup socket port created: 62095
    17:38:41 [INF][     SSH tunnel]: Starting tunnel
    17:38:41 [INF][     SSH tunnel]: Existing SSH tunnel not found, opening new one
    17:38:41 [INF][     SSH tunnel]: Opening SSH tunnel to ssh.pythonanywhere.com:22
    17:38:41 [INF][      SSHCommon]: libssh: ssh_connect ssh_connect: libssh 0.8.5 (c) 2003-2018 Aris Adamantiadis, Andreas Schneider and libssh contributors. Distributed under the LGPL, please refer to COPYING file for information about your rights, using threading threads_stdthread
    17:38:41 [INF][      SSHCommon]: libssh: ssh_socket_connect ssh_socket_connect: Nonblocking connection socket: 1976
    17:38:41 [INF][      SSHCommon]: libssh: ssh_connect ssh_connect: Socket connecting, now waiting for the callbacks to work
    17:38:43 [INF][      SSHCommon]: libssh: ssh_kex_select_methods ssh_kex_select_methods: Negotiated curve25519-sha256@libssh.org,ssh-rsa,aes256-ctr,aes256-ctr,hmac-sha2-256,hmac-sha2-256,none,none,,
    17:38:43 [INF][      SSHCommon]: libssh: ssh_packet_dh_reply ssh_packet_dh_reply: Received SSH_KEXDH_REPLY
    17:38:43 [INF][      SSHCommon]: libssh: ssh_client_curve25519_reply ssh_client_curve25519_reply: SSH_MSG_NEWKEYS sent
    17:38:43 [INF][      SSHCommon]: libssh: ssh_packet_newkeys ssh_packet_newkeys: Received SSH_MSG_NEWKEYS
    17:38:43 [INF][      SSHCommon]: libssh: ssh_packet_newkeys ssh_packet_newkeys: Signature verified and valid
    17:38:43 [INF][      SSHCommon]: libssh: ssh_packet_userauth_failure ssh_packet_userauth_failure: Access denied for 'none'. Authentication that can continue: publickey,password
    17:38:43 [INF][     SSHSession]: Banner: <<<<<<:>~ PythonAnywhere SSH. Help @ https://help.pythonanywhere.com/pages/SSHAccess

    17:38:43 [INF][      SSHCommon]: libssh: ssh_pki_import_privkey_base64 ssh_pki_import_privkey_base64: Trying to decode privkey passphrase=true
    17:38:43 [ERR][     SSHSession]: User authentication failed.
    17:38:43 [ERR][     SSH tunnel]: Authentication error opening SSH tunnel: Access denied for 'none'. Authentication that can continue: publickey,password
    17:39:24 [INF][     SSH tunnel]: Opening SSH tunnel to ssh.pythonanywhere.com:22
    17:39:24 [INF][      SSHCommon]: libssh: ssh_connect ssh_connect: libssh 0.8.5 (c) 2003-2018 Aris Adamantiadis, Andreas Schneider and libssh contributors. Distributed under the LGPL, please refer to COPYING file for information about your rights, using threading threads_stdthread
    17:39:24 [INF][      SSHCommon]: libssh: ssh_socket_connect ssh_socket_connect: Nonblocking connection socket: 2052
    17:39:24 [INF][      SSHCommon]: libssh: ssh_connect ssh_connect: Socket connecting, now waiting for the callbacks to work
    17:39:24 [INF][      SSHCommon]: libssh: ssh_kex_select_methods ssh_kex_select_methods: Negotiated curve25519-sha256@libssh.org,ssh-rsa,aes256-ctr,aes256-ctr,hmac-sha2-256,hmac-sha2-256,none,none,,
    17:39:24 [INF][      SSHCommon]: libssh: ssh_packet_dh_reply ssh_packet_dh_reply: Received SSH_KEXDH_REPLY
    17:39:24 [INF][      SSHCommon]: libssh: ssh_client_curve25519_reply ssh_client_curve25519_reply: SSH_MSG_NEWKEYS sent
    17:39:24 [INF][      SSHCommon]: libssh: ssh_packet_newkeys ssh_packet_newkeys: Received SSH_MSG_NEWKEYS
    17:39:24 [INF][      SSHCommon]: libssh: ssh_packet_newkeys ssh_packet_newkeys: Signature verified and valid
    17:39:25 [INF][      SSHCommon]: libssh: ssh_packet_userauth_failure ssh_packet_userauth_failure: Access denied for 'none'. Authentication that can continue: publickey,password
    17:39:25 [INF][     SSHSession]: Banner: <<<<<<:>~ PythonAnywhere SSH. Help @ https://help.pythonanywhere.com/pages/SSHAccess

    17:39:25 [INF][      SSHCommon]: libssh: ssh_pki_import_privkey_base64 ssh_pki_import_privkey_base64: Trying to decode privkey passphrase=true
    17:39:25 [ERR][     SSHSession]: User authentication failed.
    17:39:25 [ERR][     SSH tunnel]: Authentication error opening SSH tunnel: Access denied for 'none'. Authentication that can continue: publickey,password
    17:39:26 [INF][      WBContext]: Connection to mlsage cancelled by user: Tunnel connection cancelled

[edit by admin: formatting]

I think the important part of that log is this:

Access denied for 'none'.

What are you entering into the "SSH Username" field on MySQL workbench?

mlesage

SSH Hostname: ssh.pythonanywhere.com SSH Username: mlesage MySQL Hostname: mlesage.mysql.pythonanywhere-services.com MySQL Server Port: 3306 Username: mlesage

That's odd, the log file you quoted above says "none", but perhaps that's an artefact of Workbench's logging.

Could you let us know what your IP address is? Then I can look in the SSH server logs and see if there's anything interesting there. Probably best to tell us the IP over email, just so that it's not public here on the forums -- just drop us a line at support@pythonanywhere.com.

(You can find your IP address just by googling "whats my ip".)

Problem was eventually fixed by: 1) Installing current version of Workbench; 2) In Workbench, ensuring that under 'Connections' System Profile was set to System Type: Linux, Installation Type CentOS7(My SQL Package), Config File /etc/my.cnf/ and Configuration File Section mysqld (despite the fact that I'm running Windows) - changes were only possible by initially selecting 'SSH login based management' from Remote management, before making the changes, and then selecting 'Do not use remote management.' 3) Main settings from this page: https://help.pythonanywhere.com/pages/AccessingMySQLFromOutsidePythonAnywhere/ 4) Putty was also used to get an RSA ID, not sure if necessary or not at this point.

I see! Thanks for sharing the steps you went through!