Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Be more specific on detecting mysql socket #26

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Aug 1, 2020

  1. Be more specific on detecting mysql socket

    The previous code enumerates lists both listening and connected sockets. The output of listening (-l) is enough for the intended purpose. Optimizing this.
    
    Further on, it matches on the first socket which in my case was mysqlx.sock which leads later to a protocol error. More specific search string resolves this.
    
    As on this situation:
    # netstat -axn | grep mysql
    unix  2      [ ACC ]     STREAM     LISTENING     1934165  /var/run/mysqld/mysqlx.sock
    unix  2      [ ACC ]     STREAM     LISTENING     1934169  /var/run/mysqld/mysqld.sock
    unix  3      [ ]         STREAM     CONNECTED     1934197  /var/run/mysqld/mysqld.sock
    [...]
    
    we had 
    # netstat -axn | grep -m1 mysq
    unix  2      [ ACC ]     STREAM     LISTENING     1934165  /var/run/mysqld/mysqlx.sock
    
    and error
    ERROR 2007 (HY000): Protocol mismatch; server version = 11, client version = 10
    
    After the fix it finds the right socket:
    # netstat -lxn | grep -m1 mysqld.sock
    unix  2      [ ACC ]     STREAM     LISTENING     1934169  /var/run/mysqld/mysqld.sock
    stephankn authored Aug 1, 2020
    Configuration menu
    Copy the full SHA
    bd9f1e1 View commit details
    Browse the repository at this point in the history