Unable to remotely connect to MySQL - tried everything

Discussion in 'Installation/Configuration' started by Dedas, Oct 4, 2017.

  1. Dedas

    Dedas New Member

    Hi,
    I've been struggling with this problem for days and getting nowhere.

    My setup:
    Debian 8
    ISPConfig 3.1.6

    The mysql on port 3306 is LISTENING.

    I'm able to connect to the db correctly from LAN addresses but not remotely. I am able to connect to the server on port 3306 remotely via telnet.

    My my.cnf
    bind-address = 0.0.0.0

    The username connecting is given % and all granted.

    All help is welcome!
     
  2. HSorgYves

    HSorgYves Active Member HowtoForge Supporter

    Error Message?
     
  3. Dedas

    Dedas New Member

    Error message is: "Lost connection to MySQL server at 'reading authorization packet', system error: 2"
     
  4. HSorgYves

    HSorgYves Active Member HowtoForge Supporter

    What application are you using to connect?
    And what OS?
     
  5. Dedas

    Dedas New Member

    The error message above comes from MySQL Workbench Windows 10.
    Error message connecting from another Debian 8 machine with mysql reads:
    ""ERROR 2013 (HY000): Lost connection to MySQL server at 'reading authorization packet', system error: 2 "No such file or directory""
     
  6. ztk.me

    ztk.me Well-Known Member HowtoForge Supporter

    could be some timeout issue up to firewall ...
    does it take some time before receiving the error message? that could indicate mysql is doing name-lookup and dies trying due to incorrect dns

    try
    SET GLOBAL connect_timeout = 10;

    and/or add to my.cnf
    skip-name-resolve

    restart mysql-service ( the set global is not persistent, but shouldn't be needed if everything's working fine )


    be aware that skip-name-resolve might break users specified to login from @localhost and so on, you either have to duplicate the users, allowing them to connect from 127.0.0.1 and so on or fix your dns settings
     

Share This Page