Browse Source

fix mysql connect timeout.

mysql 5.7.17
when mysql client connect to mysql server success, mysql server will push handshake data immediately.
fix sometimes mysql_otp client may lost receive handshake data.
hunkhl 8 years ago
parent
commit
9c86fb8b5d
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/mysql.erl

+ 1 - 1
src/mysql.erl

@@ -489,7 +489,7 @@ init(Opts) ->
     end,
 
     %% Connect socket
-    SockOpts = [binary, {packet, raw} | TcpOpts],
+    SockOpts = [binary, {packet, raw},{active, false} | TcpOpts],
     {ok, Socket} = gen_tcp:connect(Host, Port, SockOpts),
 
     %% Exchange handshake communication.