title: MariaDB ERROR 2013 (HY000): Lost connection to MySQL server at 'reading initial communication packet', system error: 54
body: <p>I try to connect to the remote server(MariaDB 10) on windows 7.</p>
  
  <p>The server setting in my.ini </p>
  
  <pre><code>datadir=E:/MariaDB 10/data
  port=3306
  sql_mode="STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION"
  default_storage_engine=innodb
  innodb_buffer_pool_size=2042M
  innodb_log_file_size=50M
  feedback=ON
  character-set-server=utf8
  skip-name-resolve
  [client]
  port=3306
  </code></pre>
  
  <p>The user grant privileges as below</p>
  
  <pre><code>GRANT ALL PRIVILEGES ON *.* TO 'remote'@'%' IDENTIFIED BY PASSWORD
  </code></pre>
  
  <p>And I had tried these command</p>
  
  <pre><code>&gt;&gt; nc -vz ip port
  found 0 associations
  found 1 connections:
  1:  flags=82&lt;CONNECTED,PREFERRED&gt;
  outif en0
  src 192.168.31.242 port 58576
  dst xxx.xxx.xx.xx port xxxx
  rank info not available
  TCP aux info available
  Connection to xxx.xxx.xx.xx port xxx [tcp/creativepartnr] succeeded!
  
  &gt;&gt;telnet xxx.xxx.xx.xx port
  Trying xxx.xxx.xx.xx...
  Connected to xxx.xxx.xx.xx.
  Escape character is '^]'.
  Connection closed by foreign host.
  
  
  
  &gt;&gt;mysql -uremote -p -hxxx.xxx.xx.xx --port=xxxx
  ERROR 2013 (HY000): Lost connection to MySQL server at 'reading initial communication packet', system error: 54
  </code></pre>
  
  <p>Got the error response immediately.</p>
  
  <p>Can't find any other's situation with system error:54. </p>
  
  <p>I tried the same mysql command on localhost with ip and port and it could be logined. </p>
  
  <ol>
  <li>Is it the firewall setting problem on the Switch?(It's worked fine with command nc -vz.)</li>
  <li>Is it the database setting problem?(It's work well on localhost.)</li>
  </ol>