title: mysql-binlog-connector-java - Could not find first log file name in binary log index file
body: <p>I am doing a POC on this library, and I am having some difficulties setting it up. I have an extremly simple MySQL setup:
  - a single VM (no master-slaves)
  - centos 7
  - MySQL version 5.7</p>
  
  <p>Here is the code I have until now:</p>
  
  <pre><code>public static void main(String[] args) throws IOException {
  
      BinaryLogClient client = new BinaryLogClient("***.***.***.***", 3306, "****", "******");
      client.setBinlogFilename("/var/log/mysql/mysql-bin");
  
      client.registerLifecycleListener(new BinaryLogClient.LifecycleListener() {
          @Override
          public void onConnect(BinaryLogClient binaryLogClient) {
              System.out.println("OnConnect()");
          }
          @Override
          public void onCommunicationFailure(BinaryLogClient binaryLogClient, Exception e) {
              System.out.println("OnCommunicationFailure()");
              e.printStackTrace();
          }
          @Override
          public void onEventDeserializationFailure(BinaryLogClient binaryLogClient, Exception e) {
              System.out.println("OnEventDeserialize()");
          }
          @Override
          public void onDisconnect(BinaryLogClient binaryLogClient) {
              System.out.println("OnDisconnect()");
          }
      });
  
      client.registerEventListener(new EventListener() {
          @Override
          public void onEvent(Event event) {
              System.out.println(event.toString());
          }
      });
      client.connect();
  }
  </code></pre>
  
  <p>When running this code I get the following output:</p>
  
  <blockquote>
    <p>OnCommunicationFailure()
    com.github.shyiko.mysql.binlog.network.ServerException: Could not find first log file name in binary log index file
        at com.github.shyiko.mysql.binlog.BinaryLogClient.listenForEventPackets(BinaryLogClient.java:882)
        at com.github.shyiko.mysql.binlog.BinaryLogClient.connect(BinaryLogClient.java:559)
        at Main.main(Main.java:40)</p>
  </blockquote>
  
  <p>My MySQL configuration file content:</p>
  
  <blockquote>
    <p>[mysqld] </p>
    
    <p>datadir=/var/lib/mysql socket=/var/lib/mysql/mysql.sock</p>
    
    <p>symbolic-links=0</p>
    
    <p>log-error=/var/log/mysql/mysqld.log </p>
    
    <p>server_id=1</p>
    
    <p>log-bin=/var/log/mysql/mysql-bin </p>
    
    <p>pid-file=/var/run/mysqld/mysqld.pid</p>
    
    <p>bind-address=<strong><em>.</em></strong>.<strong><em>.</em></strong></p>
  </blockquote>
  
  <p>The contents of my log directory is as follows:</p>
  
  <pre><code>[mysql]# ls
  error.log  mysql-bin.000001  mysql-bin.index  mysqld.log
  </code></pre>
  
  <p>and the contents of mysql-bin.index is of course:</p>
  
  <pre><code>/var/log/mysql/mysql-bin.000001
  </code></pre>
  
  <p>All of the online solutions for this problem refer to a master slave configurations and the solutions are accordingly - help anyone?:)</p>