MySQL 5.7.10 issues with Ruby on OSX 10.11.3
<p>I successfully installed mySQL 5.7.10 and the mySQL gem for Ruby on my OSX 10.11.3 based system. I am trying now to run following code:</p>

<pre><code>require 'mysql'
require 'cgi'
class MysqlSaver
  def saveWordStats(globalWordStats,time)
    con = Mysql.new 'localhost', 'x', 'x', 'x'
    i = 0
    for word in globalWordStats.keys[0..10000]
      print "#{i}\r"
      i+=1
      stat = globalWordStats[word]
      time = time
      escaped_word = Mysql.escape_string(word)
      begin
        escaped_word = escaped_word.gsub("\\","")
        escaped_word = escaped_word.gsub("/","")

        escaped_word = escaped_word.gsub("-","")
        escaped_word = "#{escaped_word}_word"
        con.query("CREATE TABLE IF NOT EXISTS #{escaped_word}(percent DOUBLE, time INT)")
        con.query("INSERT INTO #{escaped_word}(percent,time) VALUES('#{stat}','#{time}')")
      rescue
        puts "#{$!}"
      end

    end
    con.close
    puts "DONE"
  end

end
</code></pre>

<p>This code works without any errors. I'am able to create tables and store values in my mySQL database. But however, if I try to create/store >= ≈10.000 values  in my database with this code I am no longer able to connect to my mySQL server, after the script finished running:</p>

<pre><code>mySQL.rb:5:in `new': Lost connection to MySQL server at 'reading initial communication packet', system error: 102 (Mysql::Error)
from /Users/david/Desktop/Birta2/mySQL.rb:5:in `saveWordStats'
from run.rb:84:in `&lt;main&gt;'
</code></pre>

<p>Also a restart of the mySQL server doesn't help (only a restart of my entire mac helps!). </p>

<p>After the error occurs I can find this strange line in the mySQL log file:</p>

<pre><code>2016-02-11T18:20:51.177054Z 0 [Warning] File Descriptor 1098 exceedeed FD_SETSIZE=1024 
</code></pre>

<p>Is there any way to fix this error?</p>